Due 21 Sept. 2016, 10AM. in class.
40 Points
This is a work sheet assignment, all work is to be done on the work sheet you will print following the instructions below.
This means this page is due in class at start of class on the due date.
You will create two sets of commands which will be run in various combinations using the different command line delimiters. See below for constructing these.
The first set, s1, s2, s3, s4, and s5 will print their name and issue a successful return code of 0 on completion.
The other set, f1, f2, f3, f4, and f5, will print their name and and issue a non-zero return code equal to the number portion of their name on completion.
You will be assigned a set of 20 5-command sequences which mix &&, ||, ;, and () between the commands.
Click here to get the list of command sequences. Print this out.
In a work directory on hopper/turing, create the two sets of commands and run each of the sequences. You may use any Linux text editor, pico, vim, emacs. You can also create the files on a PC and sftp them up to your account.
For each of the success commands, s1, s2, s3, s4, and s5, copy the following bash shell script into a file. Make it executable.
If you want, you can create a single file and hard link the 4 additional names to the original file.
#!/bin/bash echo $0 exit 0
For each of the fail commands, f1, f2, f3, f4, and f5, copy the following bash shell script. If you want, you can create a single file and hard link the 4 additional names to the original file.
#!/bin/bash echo $0 rc=`echo $0 | cut -c4` exit $rcFor each problem on the work sheet, first, see if you can predict which command will run. Remember, the 1st command always runs. Then enter the command sequence in hopper or turing as it is shown and run it.
As they run, they will print out their names. For each of the commands, indicate which ran by circling it on the worksheet and write the value of the exit status after the "echo $?" on the work sheet.
Make sure you put your Name on the work sheet.
Turn the worksheet in to me or your TA.