Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

666 bytes added, 2 March
Using Variables in Shell Scripts
Refer to the diagram to the right for examples using positional and special parameters.
'''Command Substitution:'''
[[Image:for-command-substitution.png|thumb|right|300px|Example of how a '''for loop with command substitution''' works.]]
<i>'''Command substitution''' is a facility that allows a command<br>to be run and its output to be pasted back on the command line as arguments to another command.</i><br>Reference:<br><br>
<span style="font-family:courier"><b>command1 $(command2)</b><br>or<br><b>command1 `command2`</b></span><br><br>
<span style="font-family:courier;font-weight:bold">file $(ls)<br>mail -s "message" $(cat email-list.txt) < message.txt<br><br>
===Using Control Flow Statements in Shell Scripts===

Navigation menu