HELP! I have to write a basic UNIX shell that will read in a file, and print out the number of words in the file. I need to create a system that will take a file and output information to standard out (the screen) about the number of words in a file. A word is defined as characters delineated by standard white spaces. I have to have a "driving" shell script named worfo and will use system commands and utilities. Also, my system has to do the following extra's:
Accept the option -n, meaning to use all non-alpha characters to delimit words
Accept the option -u, meaning to only count unique words
I am having problems starting out on how to do this! Any advice and help is GREATLY appreciated!
HELP! I have to write a basic UNIX shell that will read in a file, and print out the number of words in the file. I need to create a system that will take a file and output information to standard out (the screen) about the number of words in a file. A word is defined as characters delineated by standard white spaces. I have to have a "driving" shell script named worfo and will use system commands and utilities. Also, my system has to do the following extra's:
Accept the option -n, meaning to use all non-alpha characters to delimit words
Accept the option -u, meaning to only count unique words
I am having problems starting out on how to do this! Any advice and help is GREATLY appreciated!
to sum it up - read file, word count, read input, make case loop....I mean, the whole soultion is here in the forum. You only have to search. first try then ask.....
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.
(6) Do not post classroom or homework problems.
I have combined your two threads. For posterity, the title of the other thread was "need help scripting!".
It looks like you started the second one after admitting in the first thread that this was a class assignment. If this assignment is too difficult for you, then you need to discuss that with your instructor.