Question
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
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 hw8.sh using nano
or any other text editor
1.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.
2.Using 3 commands on the same command line
Go to your home directory
Run ls
Return to your hw8 directory
3.Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw8 directory. Write a single command line that
Runs bother10.sh in the background sending the output to /dev/null
Runs bother10.sh in the background sending the output to /dev/null
Runs bother10.sh in the background sending the output to /dev/null
Runs ps in the foreground
4.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 hw8 directory
Show your position in the filesystem
5.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
6.Do the following
Copy print_foo_bar.sh from /home/ghoffman/course_files/it244_files to your hw8 directory
Run print_foo_bar.sh
The value of foo will not print because it is local to the login shell and cannot be seen in a subshell.
7.Do the following
Create the global variable my_city and assign it the name of the town you live in
Write an echo statement that uses my_city to tell me where you live. The entire statement must be quoted.
8.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.
9.Print the value of the keyword shell variable whose value is the absolute pathname of your default shell.
10.Run a command that will show you all your global variables.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started