Open main menu

CDOT Wiki β

Changes

Tutorial12: Shell Scripting - Part 2

317 bytes added, 09:15, 27 July 2020
Additional Loop Statements
===Additional Loop Statements===
x
 
 
 
'''for Loop using Command Substitution'''
 
Let’s issue the for loop with a list using �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.
 
for x in $(ls)
do
echo “The item is: $x”
done
===Using Startup Files===
13,420
edits