- What do [ and ] mean when used in an
ifstatement?they stand for thetestcommand- Is there any limit to the number of blocks of commands you can have in an
if ... else ... elifstatement?no- When does a
whileloop stop running?when the command followingwhilereturns an exit status that is not 0- What does the
breakcommand in a loop do?jumps completely out of the loop- Write the command you would use to create the files foo1.txt to foo5.txt using brace expansion and the
touchcommand.touch foo{1,2,3,4,5}.txt- Can an alias be made global?
no- What is the value of the exit status returned by
testto indicate that the expression is true?0- Does the command that follows
ifneed to betest?no, it can be any command that returns an exit status- What parameter gives the total number of arguments passed to a script from the command line?
#- What parameter gives the full pathname of the script that is currently being run?
0- What is special about a GLOBAL variable?
you can use it in any subshell of the shell in which it was created.- What are the limitations of a LOCAL variable?
you can only use it in the shell in which it was created- What would you type at the command line if you wanted to suspend a job running in the foreground?
Control Z- What command would you use to see all currently running jobs?
jobs- By default, where does Standard Input come from?
the keyboard- By default, where does Standard Output go?
to the screen- By default, where does Standard Error go?
to the screen- What does the PATH shell variable contain?
the list of directories the shell must search to find the file to run a command- What is a process?
a running program- What does a program do just before it stops running?
it sends an exit status to the shell- Look at the diagram at the back of this exam.
Assume that you are in the directory it244.
Write the ABSOLUTE pathname you would use to reference the directory proj1 inside the directory jimbo.
I do not want a command, just the pathname./home/jimbo/proj1- Look at the diagram at the back of this exam.
Assume that you are in the directory courses.
Write the RELATIVE pathname you would use to reference the directory ghoffman under the directory home.
I do not want a command, just the pathname.../home/ghoffman- Look at the diagram at the back of this exam.
Assume that you are in the directory tmp inside ghoffman.
Write the RELATIVE pathname you would use to reference the root directory.
I do not want a command, just the pathname.../../..- Look at the diagram at the back of this exam.
Assume that you are in the directory courses.
Write the RELATIVE pathname you would use to reference the directory mary under f21 under it117.
I do not want a command, just the pathname.it117/f21/mary- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list all files with a .sh extension in this directory?
I do not want the full command, just the argument to that command.*.sh- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list all files whose name starts with "foo" followed by one character and ".txt" in this directory?
I do not want the full command, just the argument to that command.foo?.txt- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list the files whose name starts with "bar" followed by the digits 3 through 7, followed by ".txt"?
I do not want the full command, just the argument to that command.bar[3-7].txt- Write the format string you would give to
chmodto give a FILE the following permissions.
Give the owner read, write and execute permissions.
Give the group read permissions.
Give read and execute permissions to anyone else.
I just want the format string NOT the whole command.745- Write the format string you would give to
chmodto give a DIRECTORY the following permissions.
Give the owner all permissions.
Give the group permission to see and change the contents of the directory.
Give everyone else no permissions for that directory .760- If you ran the script bother.sh as shown below, what command would you use to stop this script?
$ ./bother.sh & [1] 26422kill 26422 or kill %1- Write a command that will print ALL global variables and their values.
env- Write the command that will find all the lines in the file memo.txt that contain the word "mountain" but not the word "range".
grep mountain memo.txt | grep -v range- What is the name of the process that starts automatically whenever pe15 is turned on?
systemd