Question: If script.sh is run in the current directory, it will fail. Why?

  1. ls: cannot access nonexistentfile: No such file or directory
  2. The for loop will split on word boundaries and Beach photo1.jpg has a space in it.
  3. The mv command will fail because the curly bracket is a special character in Bash and cannot be used in the names of files.
  4. Running script.sh will be successful as the ls command builds a list of files in the current directory and for loops through that list renaming files with a .bak extension.

Answer: The correct answer of the above question is Option B:The for loop will split on word boundaries and Beach photo1.jpg has a space in it.