I teach myself bash and using Learning bash shell to do this.
In flow control, I noticed that we define an if / else statement:
if [ statement_is_true ]; then
elif [ some_other_statement]; then
else
fi
and the case statement as such:
case $expr in
case1 )
;;
case2 )
;;
esac
but a for loop can be defined as
for i in $list;
do
done
and while loop like
while [ condition ]; do
done
Why the end of the circuit for, whileand untilis indicated done, not rof, elihwand litnu, accordingly, how if/fiand case/esacto build? (Alternatively, why is it if/fiinstead if/done?
source
share