HELP! Need HELP scripting!

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.....:wink:

This sounds like a mid-level college CS course assignment.
We don't give homework answers, but the the source code for 6494 different shells is at:

Yes, this is a college assignment, and I'm not looking for actual code. Just how to go about starting it off because I have NO idea!

check out the utility wc. And thats all the help you get.

This smells a lot like homework...

Please read our rules

note in particular:

(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.