abhi11210646 / wc-tool

Replica of a Linux utility: Word Count (WC)

Home Page:https://www.ibm.com/docs/en/aix/7.3?topic=w-wc-command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Your Own wc Tool - Coding Challenge

Build the GO program first.

go build -o ./wc ./cmd/main.go

Execute:

abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt
2  5  12   test.txt
6  8  18   test2222.txt
8  13 30   total
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt
2  5  12   test.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h

        USAGE:  wc [OPTIONS] FILE(S)
                -c      print the byte counts
                -l      print the newline counts
                -w      print the word counts  
        EXAMPLE: 
                wc -l logs.txt
                wc -w logs.txt
                wc -l logs.txt logs2.txt
          

abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
 2  5 test.txt
 6  8 test2.txt
 2  5 test.txt

wc-tool

abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h

        USAGE:  wc [OPTIONS] FILE(S)
                -c      print the byte counts
                -l      print the newline counts
                -w      print the word counts  
        EXAMPLE: 
                wc -l logs.txt
                wc -w logs.txt
                wc -l logs.txt logs2.txt
          

abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
 2  5 test.txt
 6  8 test2.txt
 2  5 test.txt

About

Replica of a Linux utility: Word Count (WC)

https://www.ibm.com/docs/en/aix/7.3?topic=w-wc-command


Languages

Language:Go 100.0%