Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

10 bytes removed, 07:55, 18 March 2021
WHILE LOOP
This repeats until the condition/expression becomes '''FALSE'''.<br>Reference: https://en.wikipedia.org/wiki/While_loop<br><br>
''Example1:''
<span style="font-family:courier;font-weight:bold">answer=10<br>read –p “pick a number between 1 and 10: “ guess<br>while test $guess –eq 10<br>do &nbsp;&nbsp;&nbsp;read –p “Try again: “ guess<br>done<br>echo “You are correct”</span><br><br>
''Example using a Loop2:''
<span style="font-weight:bold;font-family:courier;">
5
</span>
 
====EXIT &amp; BREAK STATEMENTS====
13,420
edits

Navigation menu