Question: If script.sh is run in the current directory, it will fail. Why?
- ls: cannot access nonexistentfile: No such file or directory
- The for loop will split on word boundaries and Beach photo1.jpg has a space in it.
- The mv command will fail because the curly bracket is a special character in Bash and cannot be used in the names of files.
- 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.