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

  1. What is special about a GLOBAL variable?
    you can use it in any subshell of the shell in which it was created.
  2. What are the limitations of a LOCAL variable?
    you can only use it in the shell in which it was created
  3. What would you write on the command line to set the value of the LOCAL variable named team to Red Sox.
    team="Red Sox"
  4. If you define a local variable, can a script see the value of this variable?
    no
  5. 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"
  6. 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
  7. What command would you use to see all GLOBAL variables?
    env
  8. What character would you use if you wanted to run two commands IN THE FOREGROUND, one right after the other, on a SINGLE command line?
    ;
  9. What other two characters allow more than one command to be run on a SINGLE command line?
    & and | (the pipe character)
  10. How can you continue a command onto the next line?
    type \ immediately before hitting Enter