Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

35 bytes added, 09:34, 5 September 2020
Additional Loop Statements
''Example:''
<span style="font-family:courier;font-weight:bold;">for x in $(ls)<br>do<br> &nbsp;&nbsp;&nbsp;echo “The item is: $x”<br>done</span><br><br>
[[Image:while-loop.png|thumb|right|170px|Example of how a '''while''' loop works.]]'''Using the while Loop Statement'''
''Example:''
<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>
===Using Startup Files===
13,420
edits

Navigation menu