13,420
edits
Changes
→EXIT & BREAK STATEMENTS
====EXIT & BREAK STATEMENTS====
'''Exit <span style="font-family:courier;font-weight:bold;">exit</span> Statement'''
The '''exit''' statement is used to '''terminate''' a shell script.
fi<br>
</code>
<br><br>
'''<span style="font-family:courier;font-weight:bold;">break</span> Statement'''
The '''break''' statement is used to terminate a loop.<br>
Although the loop terminates, the shell script will continue running.�
''Example:�''
<cod>
read -p "Enter a number: " number<br>
while [ $number -ne 5 ]<br>
do<br>
read -p "Try again. Enter a number: " number<br>
if [ $number -eq 5 ]<br>
then<br>
break<br>
fi<br>
done<br>
</code>
<br><br>
===START-UP FILES===