Skip to content

abhi11210646/wc-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Your Own wc Tool - Coding Challenge

Build the GO program first.

go build cmd/wc.go cmd/helper.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