I want to ask is it possible to give multiple statements to be executed when if condition gets satisfied by doing just
if[condition] then
statements
else
statements
fi
or we have to do something else like using do.....done around that block of statements
Yes you can have multiple statements:
if [ condition ]; then
echo 'foo'
echo 'bar'
else
echo 'hello'
echo 'world'
fi
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.