IT 244: Introduction to Linux/Unix
Quiz 9 Answers

  1. What does Bash do when it performs alias substitution?
    it substitutes the value of an alias for the name of the alias when it appears on the command line
  2. Write the command you would use to create the files foo1.txt to foo5.txt using brace expansion and the touch command.
    touch  foo{1,2,3,4,5}.txt
  3. What does Bash do when it performs command substitution?
    runs the commands inside the parentheses in a subshell and substitutes the output from 
    those commands for the substitution expression
  4. What would you write at the command line to define the alias ll whose value was ls -l ?
    alias ll='ls -l'
  5. Can an alias be mode global?
    no
  6. Can a function be made global?
    no
  7. How is the command that follows if used to determine whether or not the statements between the then and fi keywords are executed?
    if the command returns an exit status of 0 the statements are executed
  8. What does the test command do?
    analyze a logical expression and return an exit status that tells 
    whether the expression is true or false
  9. What is the value of the exit status returned by test to indicate that the expression is true?
    0
  10. Does the command that follows if need to be test?
    no, it can be any command that returns an exit status