Loops/While: Difference between revisions

add UNIX Shell
m (→‎{{header|Perl}}: migrate content from Loop Structures)
(add UNIX Shell)
Line 487:
set i [expr {$i / 2}]
}</lang>
 
=={{header|UNIX Shell}}==
{{works with|Bourne Again SHell}}
<lang bash>x=1024
while [[ $x -gt 0 ]]; do
echo $x
x=$(( $x/2 ))
done</lang>
 
=={{header|UnixPipes}}==
<lang sh> (echo 1024>p.res;tail -f p.res) | while read a ; do
test $a -gt 0 && (expr $a / 2 >> p.res ; echo $a) || exit 0
done</lang>
 
 
=={{header|V}}==
<lang v> 1024 [0 >] [
dup puts
2 / >int
] while</lang>
 
=={{header|Vedit macro language}}==
Anonymous user