Questions
- How many lines will be printed on screen from the following script?
#!/bin/bash
for (( v1 = 12; v1 <= 34; v1++ ))
do
echo "$v1"
done > output
- How many lines will be printed on the screen from the following script?
#!/bin/bash
for (( v=8; v <= 12; v++ ))
do
if [ $v -ge 12 ]
then
break
fi
echo "$v"
done
- What is wrong with the following script? And how can you fix it?
#!/bin/bash
for (( v=1, v <= 10, v++ ))
do
echo "value is $v"
done
- How many lines will be printed on the screen from the following script?
#!/bin/bash
count=10
while (( count >= 0 )) ; do
echo $count
done
$((count--))
exit 0