IT 244: Introduction to Linux/Unix
Answers to Class 26 Ungraded Quiz

  1. If the variable dir_name had the value "hw", how would you use this variable to create the string "hw10"?
    ${dir_name}10
  2. What is the value stored in the special parameter $ ?
    The process ID of the current shell.
  3. What is the value stored in the special parameter ! ?
    The process ID of the last command sent into the background
  4. What is the value stored in the special parameter ? ?
    The exit status of the last command run.
  5. What is the value stored in the positional parameter 0 ?
    The pathname used to run a script
  6. What are the values stored in the positional parameters 1 to n ?
    The value of the corresponding command line argument
  7. What is the value stored in the special parameters * and @ ?
    all the command line arguments
  8. How are the values of the special parameters set?
    they are set by Bash
  9. What happens after the following command is run in a script?
    shift
    all positional parameter values are moved to the previous positional parameter
  10. 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