Jump to content

Loop structures: Difference between revisions

Added UNIX Shell
(Added TCL.)
(Added UNIX Shell)
Line 467:
puts "$i"
}
 
==[[UNIX Shell]]==
[[Category:UNIX Shell]]
===for===
'''Interpreter:''' [[Bourne Again SHell]]
 
#!/bin/bash
ARRAY="VALUE1 VALUE2 VALUE3 VALUE4 VALUE5"
for ELEMENT in $ARRAY
do
echo $ELEMENT # Print $ELEMENT
done
 
'''Interpreter:''' [[Debian Almquist SHell]]
 
#!/bin/sh
ARRAY="VALUE1 VALUE2 VALUE3 VALUE4 VALUE5"
for ELEMENT in $ARRAY
do
echo $ELEMENT # Print $ELEMENT
done
Cookies help us deliver our services. By using our services, you agree to our use of cookies.