Does a while loop always execute at least once


Discussion:

Give brief answers for the following Bash questions.

Q1) Does filename generation occur on variable assignment?

Q2) In the traditional Bourne Shell, does a sub-shell get created when there is I/O redirection to a loop?

Q3) Will the following command always correctly loop through each of the positional parameters?

for I in "$*"
do
echo $I
done

Q4) Will the following loop always execute only once?

for I in "$@"
do
echo $I
done

Q5) Will the following command sometimes execute once?

for I do echo $I done

Q6) Does a while loop always execute at least once?

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Does a while loop always execute at least once
Reference No:- TGS01933534

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)