I need urgent help - Basic shell scripts but I'm clueless.

Hello. I am currently in a class dealing with shell scripts. I know some commands and get the basics of command line in Fedora 11. But the coding....I'm a bit lost. I was very ill for 2 weeks and missed a lot, much of which there are no notes provided.

I'm not asking you to do my homework, because this isn't an assignment for marks. But it's an assignment nonetheless and I WANT to understand it.

I need to make scripts of the following. But in the simplest form, please, we're still dealing with low-level stuff. You guys are experts - I just need you to write this up and tell me what's going on (I'm lost on some syntax)

1) Accepts text from command line, then reverses the order of the words but not the words themselves. i.e. "One two three four" displays "four three two One". If the command line argument isn't any words, an error message is returned and a value of 1 is returned to the O/S.

2)

3)

I am so lost right now that it scares me. I am only well enough to return to school today, and I am expected to comprehend these things by tomorrow..... D:

Any lifesavers here?

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.