$ cat excerpted/0 The 19 rabbits sat; then, the rabbits jumped --- oh, what a sight o'er the land we saw the rabbits' jumping for all. Were there a rabbit's leap so all-inspiring that we could ask "Did they all jump so high"? $ ./wl.bash excerpted/0 all all-inspiring ask could did er for high jump jumped jumping land leap oh rabbit rabbits sat saw sight so that the then there they we were what
You can use any of Bash built-in features (echo, array variables, and so forth) to do this. You can also use any of these programs in your shell script are:
You don't necessarily need to use all of the above programs, but I don't think you can write a version that does not use any of the above programs, and that only uses Bash built-ins. (Indeed, I will give you extra credit if you write a version that only uses Bash built-ins to do this.)
As to how to do the assignment, login to cop3353.org, and create a subdirectory called "wordlist/"; then retrieve the current texts with tar:
cop4342test@cop3353:~$ mkdir wordlist cop4342test@cop3353:~$ cd wordlist cop4342test@cop3353:~/wordlist$ tar xf /usr/local/Wordlist-assignment/excerpts/excerpted-2019-03-15.tar cop4342test@cop3353:~/wordlist$ ls excerptedPlease create your wl.bash in the subdirectory ~/wordlist/ (not in your home directory or in ~/wordlist/excerpted).
The contents of the tar file are:
$ ls -al total 2780 drwx------ 2 cop4342test cop4342test 4096 Mar 15 16:29 . drwxr-xr-x 3 cop4342test cop4342test 4096 Mar 15 16:39 .. -rw-r--r-- 1 cop4342test cop4342test 212 Mar 15 15:56 0 -rw-r--r-- 1 cop4342test cop4342test 147 Mar 15 16:29 0.out -rw------- 1 cop4342test cop4342test 84252 Mar 13 16:10 10 -rw-r--r-- 1 cop4342test cop4342test 20372 Mar 14 20:19 10.out -rw------- 1 cop4342test cop4342test 69855 Mar 14 20:18 11 -rw-r--r-- 1 cop4342test cop4342test 14035 Mar 14 20:19 11.out -rw-r--r-- 1 cop4342test cop4342test 261963 Mar 14 20:10 6 -rw-r--r-- 1 cop4342test cop4342test 49687 Mar 14 20:19 6.out -rw-r--r-- 1 cop4342test cop4342test 121003 Mar 14 20:53 7 -rw-r--r-- 1 cop4342test cop4342test 28904 Mar 14 20:19 7.out -rw-r--r-- 1 cop4342test cop4342test 1751447 Mar 14 18:02 8 -rw-r--r-- 1 cop4342test cop4342test 138141 Mar 14 20:19 8.out -rw------- 1 cop4342test cop4342test 218915 Mar 14 20:16 9 -rw-r--r-- 1 cop4342test cop4342test 45346 Mar 14 20:19 9.outThe ".out" files are sample output that you can compare your results with. The unadorned numbered files are your sample input files.
Please make sure that you downcase all your output, that you remove all duplicates, and that you put everything in alphabetical order.
This assignment is due by the beginning of class on Wednesday, March 27. Your programs should be able to produce identical output for the sample files, and should be able to handle similar text files in addition to the provided samples.