-
If you wanted to run the executable file backup.sh in your current directory,
but wanted the error messages to disappear, what would you write at the command line?
./backup.sh 2> /dev/null
-
What would you type at the command line, if you wanted to make the script cheer.sh
executable?
chmod 755 cheer.sh
-
Write the hashbang line we use for scripts in this course.
#! /bin/bash
-
What command would you use to make the changes you made in the startup file for your login shell take effect?
source .bash_profile
-
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 write on the command line to set the value of the LOCAL
variable named team to Red Sox.
team="Red Sox"
-
If you define a local variable, can a script see the value
of this variable?
no
-
What would you write on the command line to create the GLOBAL
variable named school and set its
value to UMass Boston.
export school="UMass Boston"
-
Write the command you would use in a script to ask the user to provide
a value for a variable named dir
read -p "Directory: " dir