Steps for Script
-
Perform the following actions
- Run ls on a file that does not exist
- Run ls on the same file, but redirect Standard Error to
/dev/null
- Run ls on the same file, but redirect Standard Error to
errors.txt
- Print errors.txt to the terminal
Run one command for each of the items above.
-
Using 3 commands on the same command line
- Go to your home directory
- Run ls
- Return to your hw08 directory
-
Copy bother10.sh from /home/ckelly/course_files/it244_files
to your hw08 directory.
Write a single command line that
- Run bother10.sh in the background sending the output to /dev/null
- Run bother10.sh in the background sending the output to /dev/null
- Run bother10.sh in the background sending the output to /dev/null
- Run ps in the foreground
-
Using the directory stack mechanism do the following
- Go to your home directory
- Show your position in the filesystem
- Go to my home directory
- Show your position in the filesystem
- Return to your home directory
- Show your position in the filesystem
- Return to you hw08 directory
- Show your position in the filesystem
-
Do the following
- Create the local variable foo and assign it the value "FOO"
- Create the global variable bar and assign it the value "BAR"
- Write a single command that will print the values of foo and bar
-
Copy print_foo_bar.sh from /home/ckelly/course_files/it244_files
to your hw08 directory.
Run print_foo_bar.sh.
foo will not print because it is local to the login shell and cannot be seen in a subshell.
-
Do the following
- Create the global variable my_city and assign it the name of the town you live in
-
Print the value of the keyword shell variable whose value is a list of all the directories Bash will search to find an executable file with the
same name as the command you typed on the command line.
-
Print the value of the keyword shell variable whose value is the absolute pathname of your default shell.
-
Run a command that will show you all your global variables.