I have a test coming up, and this is one of the questions on the study guide, but I'm not sure which is the correct answer. I believe the answer is the 4th choice. Can someone confirm this?
Consider the following Bash script. Which of the following statements is true?
#!/bin/bash
echo "ls" > newscript.sh
for i in {1..6}
do
let REM=($i % 2)
chmod -x newscript.sh
if [ $REM -eq 0 ]
then
chmod +x newscript.sh
fi
done
./newscript.sh
Select one:
newscript.sh will not run because the execution bit is not set
newscript.sh will run but produce no output
newscript.sh will run because the execution bit is set
newscript.sh will run but will produce an error
newscript.sh will not run because it is not a valid script