IT 244: Introduction to Linux/Unix
Homework 7
Due Sunday, March 25th at 11:59 PM
All this work should be done on users3.cs.umb.edu
Deliverables
-
A shell script named hw7.sh that performs the operations listed below.
This file should be in an hw7 directory inside your
hw directory inside your it244 directory.
100 points
Requirements
- Create an hw7 directory in your hw directory
inside your it244 directory
- Go to the hw7 directory and run Unix commands that will execute the steps below
- When you have a command line that does what the step asks you to do, paste it into
hw7.sh using
nano
or any other text editor
- When you have completed all the steps, create an
echo
statement before the commands
for each step, that will print the step number to the terminal
Testing
- The script hw7.sh must have the format specified in
this document
- Scripts that do not follow the rules specified in the document mentioned above will
will have points deducted from their score
- Be sure you make the script executable by running the following command
chmod 755 hw7.sh
- Be sure to test your script and correct any errors you find
- You will lose 5 points for each error that occurs when running your script
- To run your script and see only the error messages run the following command
./hw7.sh > /dev/null
Steps for Script
-
Copy bother10.sh from /home/tsoro/course_files/it244_files
to your hw7 directory.
Run this program in the background redirecting output to /dev/null.
Be sure you copy and run bother10.sh, NOT bother.sh.
-
Run a command that shows the job number of the process running bother10.sh.
-
Run a command that shows the process ID of the process running bother10.sh.
-
Copy the script make_foo.sh from ~tsoro/course_files/it244_files
to your current directory.
Run this script.
Perform a long listing of all files whose name starts with the string "foo" using meta-characters.
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single character, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single digit, either 1, 3 or 5, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single digit from 1 through 5 followed by .txt . Do this using the range feature of one of the meta-characters.
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by a single digit, not 1, nor 3 nor 5, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by two digits followed by .txt .
-
Using meta-characters, perform a long listing of the files foo21.txt, foo25.txt
and foo29.txt. This must be done using a single command.