Shell programming: Difference between revisions

From 탱이의 잡동사니
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:linux]]
[[category:shell]]

Revision as of 12:55, 10 August 2015

Overview

리눅스 쉘 프로그래밍 정리

Statements

for

<source lang=bash>

  1. !/bin/sh

for var in A B C do

   echo "var is $var"

done </source>

while

while 은 조건이 만족하는 동안 루프를 반복한다. <source lang=bash>

  1. !/bin/sh

a=0 while [ $a -lt 10 ] do

   a=`expr $a + 1`
   echo $a

done </source>

See also

References

<references />