13,420
edits
Changes
→Additional Loop Statements
Let’s issue the for loop with a list using command substitution.<br>In the example below, we will use command substitution to issue the ls command and<br>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>