Shell programming: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Overview == 리눅스 쉘 프로그래밍 정리 == Statements == === for === <source lang=bash> #!/bin/sh for var in A B C do echo "var is $var" done </source> ===...") |
No edit summary |
||
Line 32: | Line 32: | ||
<references /> | <references /> | ||
[[category: | [[category:shell]] |
Revision as of 12:55, 10 August 2015
Overview
리눅스 쉘 프로그래밍 정리
Statements
for
<source lang=bash>
- !/bin/sh
for var in A B C do
echo "var is $var"
done </source>
while
while 은 조건이 만족하는 동안 루프를 반복한다. <source lang=bash>
- !/bin/sh
a=0 while [ $a -lt 10 ] do
a=`expr $a + 1` echo $a
done </source>
See also
- https://wiki.kldp.org/wiki.php/DocbookSgml/Shell_Programming-TRANS - Shell 프로그래밍의 기본
References
<references />