Shell programming

From 탱이의 잡동사니
Revision as of 12:55, 10 August 2015 by Pchero (talk | contribs)
Jump to navigation Jump to search

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 />