Class 26 Flashcards
If the variable dir_name had the value “hw”, how would you use this variable to create the string “hw10”?
${dir_name}10
What is the value stored in the special parameter $ ?
The process ID of the current shell.
What is the value stored in the special parameter ! ?
The process ID of the last command sent into the background
What is the value stored in the special parameter ? ?
The exit status of the last command run.
What is the value stored in the positional parameter 0 ?
The pathname used to run a script
What are the values stored in the positional parameters 1 to n ?
The value of the corresponding command line argument
What is the value stored in the special parameters * and @ ?
all the command line arguments
How are the values of the special parameters set?
they are set by Bash
What happens after the following command is run in a script? shift
all positional parameter values are moved to the previous positional parameter
What happens after the following command is run in a script? shift 2
all positional parameters values are moved to the positional two steps lower