Which of the following is syntactically valid in a standard Bash shell script…
PYQ IBPS SO CRP SPL-XIV (2024)
Which of the following is syntactically valid in a standard Bash shell script for iterating through a list of values using a for loop?
- A.
for(i=0; i<5; i++)
{
} - B.
for i in 1 2 3 4 5
do
echo $i
done - C.
foreach i = 1 to 5
echo $i
end - D.
loop i from 1 to 5
print $i - E.
for i = 1:5
echo $i
endfor
Attempted by 123 students.
Sign up free to check your answer
Sign up freeLoading lesson…

