Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash for loop multiple statements

# Basic syntax:
for i in a b; do echo $i; printf "$i	$i
"; done
# Where:
#	- each command in the for loop needs to be separated by semicolons. Here
#		we echo $i and then print $i<tab>$i<newline>
#	- over several lines this would be equivalent to:
for i in a b
do
  echo $i
  printf "$i	$i
"
done
Source by ma.ttias.be #
 
PREVIOUS NEXT
Tagged: #bash #loop #multiple #statements
ADD COMMENT
Topic
Name
1+7 =