<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Unix on ZK Punk</title>
		<link>https://www.ZKPunk.dev/tags/unix/</link>
		<description>Recent content in Unix on ZK Punk</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Mon, 11 Mar 2019 00:21:00 -0800</lastBuildDate>
		
			<atom:link href="https://www.ZKPunk.dev/tags/unix/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>WC implementation in Go Lang</title>
				<link>https://www.ZKPunk.dev/posts/wc_implementation_in_golang/</link>
				<pubDate>Mon, 11 Mar 2019 00:21:00 -0800</pubDate>
				<guid>https://www.ZKPunk.dev/posts/wc_implementation_in_golang/</guid>
				<description>&lt;p&gt;Continuing the theme of exploring &lt;a href=&#34;https://golang.org/&#34;&gt;Go Lang&lt;/a&gt;, today I will be writing a simple version&#xA;of the &lt;code&gt;Unix&lt;/code&gt; utility &lt;code&gt;wc&lt;/code&gt; that displays the number of lines, words, and bytes contained in each&#xA;input file.&lt;/p&gt;&#xA;&lt;p&gt;This exploration process will involve the following pieces&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Getting a file name from command line. &lt;a href=&#34;https://golang.org/pkg/os/&#34;&gt;os&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Opening the file for reading. &lt;a href=&#34;https://golang.org/pkg/os/&#34;&gt;os&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Reading the contents of the file. &lt;a href=&#34;https://golang.org/pkg/bufio/&#34;&gt;bufio&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Count the lines, words and bytes. &lt;a href=&#34;https://golang.org/pkg/unicode/&#34;&gt;unicode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Display the results.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;1-read-filename-from-the-commandline&#34;&gt;&#xA;  1. Read filename from the commandline&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#1-read-filename-from-the-commandline&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;p&gt;Any arguments typed after the programs named are passed into the &lt;a href=&#34;https://golang.org/pkg/os/&#34;&gt;&lt;code&gt;os.Args&lt;/code&gt;&lt;/a&gt; array&#xA;with the name of the program accessible at the first index.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Exploring filesystem in golang</title>
				<link>https://www.ZKPunk.dev/posts/exploring_filesystem_in_golang/</link>
				<pubDate>Wed, 06 Mar 2019 00:12:00 -0800</pubDate>
				<guid>https://www.ZKPunk.dev/posts/exploring_filesystem_in_golang/</guid>
				<description>&lt;p&gt;I am currently dabbling in [GoLang]&#xA;&lt;a href=&#34;https://golang.org/&#34;&gt;go-lang&lt;/a&gt; and trying to get familiar with it&amp;rsquo;s syntax and style of programming. I also want to get familiar with the built-in packages for basic tasks witout having to google for basic features.&lt;/p&gt;&#xA;&lt;p&gt;In this post I will be working my way up to building a simple program that can list the files of a given path to it as a command line argument.&lt;/p&gt;&#xA;&lt;h4 id=&#34;1-print-to-console&#34;&gt;&#xA;  1. Print to console&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#1-print-to-console&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h4&gt;&#xA;&lt;p&gt;Lets start with a simple program that can print a statement to the console using the &lt;a href=&#34;https://golang.org/pkg/os/&#34;&gt;&lt;code&gt;&amp;quot;fmt&amp;quot; package&lt;/code&gt;&lt;/a&gt; and the &lt;code&gt;&amp;quot;Println()&amp;quot; fucntion&lt;/code&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>ls implementation in python3</title>
				<link>https://www.ZKPunk.dev/posts/ls_implmentation_in_python3/</link>
				<pubDate>Thu, 28 Feb 2019 00:08:00 -0800</pubDate>
				<guid>https://www.ZKPunk.dev/posts/ls_implmentation_in_python3/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Ls&#34;&gt;&lt;strong&gt;&amp;ldquo;ls&amp;rdquo;&lt;/strong&gt;&lt;/a&gt; is unix utility that lists the  files and directories in the current path or a user passed path. In this post we will explore how to achive such a basic implementation if it using python. Lets explore the &lt;strong&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt; command line utility.&lt;/p&gt;&#xA;&lt;h3 id=&#34;some-basic-information&#34;&gt;&#xA;  Some basic information&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#some-basic-information&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;First, we execute &lt;strong&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt; command line utility to get some preliminary information of a directory. Here is an example of the output from the &lt;strong&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt; command on a sample directory.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
