Hi everyone.
Let me just start off by saying I'm a college student and I love playing around with UNIX.
I registered here because I have a UNIX shell scripting class and I am having some issues with my homework. I'm not looking for answers to the problems, just some help to get me on my way.
Here is an example of one of the problems I'm having an issue with.
Quote:
Write a shell script called suffix that will do the following:
1. Insert a reference to the Bourne shell as the command interpreter of this shell script.
2. Add the appropriate comments
3. Test that exactly two command line argruments are enter from the command line. If not, display the usage message and stop the script and set the status to 1. If exactly two are entered, continue processing.
4. The first argument is the name of an existing file. The second agrument is a suffix to be added to the file when you rename it.
5. Rename the first file to the second file name with the suffix append on.
6. Cut and paste you program in the space provided along with a session of the samples being executed.
For example,
$ suffix memo1 .sv
should rename the file called memo1 to a file called memo1.sv
========
$ suffix memo1
Usage: suffix filename suffixname
========
$ suffix memo1 memo2 .sv
Usage: suffix filename suffixname
My main issue is that I don't know the syntax to cut and paste and redirect the output in such a way that it renames the file and everything.
If you guys can help me with the commands I'll need to make this script, I would greatly appreciate it.