Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

146 bytes added, 08:15, 5 September 2020
Additional Loop Statements
[[Image:for-command-substitution.png|thumb|right|300px|Example of how a '''for loop with command substitution''' works.]]
'''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.<br>Reference: https://en.wikipedia.org/wiki/Command_substitution<br><br>
Usage:
<span style="font-family:courier"><b>command1 $(command2)</b><br>or<br><b>command1 `command2`</b></span><br><br> Examples: <span style="font-family:courier;font-weight:bold">file $(ls)<br>mail -s "message" $(cat email-list.txt)<br><br><br> 
13,420
edits

Navigation menu