System/OS
2003.04.23 10:36
[linux] 셀 스크립트 if, for, case in..
조회 수 13763 댓글 0
스크립트 인수1 인수2 인수3
#!/bin/sh
echo $1; echo $2; echo $3
if then, elif, else 제어문
echo -n 'enter a number : '
read number
if [ $number -lt 0 ]
then
echo smaller than zero
elif [ $number -eq 0 ]
then
echo zero
else
echo bigger than zero
fi
case in 제어문
for color in blue red green
do
echo one color is $color
done
case in 제어문
case 변수 in
"first")
first 경우의 실행 코드
;;
"second")
second 경우의 실행 코드
;;
"third")
third 경우의 실행 코드
;;
*)
Default 경우
;;
esac
-
[linux] 리눅스,유닉스 /proc/stat 파일 보는 법
-
[linux] 메일서버 세팅정보(sendmail)
-
[linux] 메타(기호)문자의 의미와 사용
-
[linux] 새 하드디스크 추가하기..(내공쌓기)
-
[linux] 센드메일 동적릴레이 설치
-
[linux] 셀 스크립트 if, for, case in..
-
[linux] 쉘 스크립트 (Shell Script)
-
[linux] 쉘 스크립트에 대한 설명과 예제..
-
[linux] 쉘 환경변수 PS1(프롬프트)
-
[linux] 쉘스크립트 expr
-
[linux] 스케쥴링 순서(nice) 변경하기
-
[linux] 시스템 데몬 종류와 설명