Store all of your files for this lab in a folder named "lab1".
In this lab you will create filter programs. A filter reads all of it's input, processes that input, then produces output. You will recreate 2 filter programs that are already available in Bash: nl, for numbering lines and wc, a word counting program.Suppose you have a file named data.txt and it contains the following data:
The quick brown fox jumped over the lazy dog.The nl command numbers the lines coming from it's input. Using the following command in bash:
nl < data.txtProduces the following output:
1 The quick brown 2 fox 3 jumped over 4 the lazy dog.The wc command gives you the number of lines, words, and characters of the data that it reads. This command:
wc < data.txtWill output:
4 9 46Which means that data.txt contained 4 lines, 9 words, and 46 characters. For this lab you won't have to have your wc implementation count lines or characters, just words.