My own version of wc command line tool
Just for Golang practicing! Inspired by Coding Challenges
- Install Go
- Run
go build
- OR we could run
go build -o <output_name>
to specify the output name - Move the
<output_name>
tousr/local/bin
- Example of usage
# Mimic wc -c
$ lyswc -c test.txt
# Mimic wc -l
$ lyswc -l test.txt
# Mimic wc -w
$ lyswc -w test.txt
# Mimic wc -m
$ lyswc -m test.txt
# No flag passing
$ lyswc test.txt
# Read from standard input
cat test.txt | lyswc
- Run
go test