13,420
edits
Changes
→Additional Loop Statements
===Additional Loop Statements===
'''Command Substitution�Substitution'''command substitution is a facility that allows a command to be run and its output to be pasted back <br>on the command line as arguments to another command.��Reference<br>Reference: https://en.wikipedia.org/wiki/Command_substitution
Examples:
'''for Loop using Command Substitution'''
Let’s issue the for loop with a list using �command command substitution. In the example below, we will use command substitution to issue the ls command and have that output (filenames) become arguments for the for loop.
Example <span style="font-family:courier">for x in $(ls)<br>do <br> echo “The item is: $x” <br>done</span><br><br>
===Using Startup Files===