Contents

System/OS
2003.04.23 10:36

[linux] 셀 스크립트 if, for, case in..

조회 수 13699 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
스크립트   인수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 


?

  1. [linux] ssh에서 원격 파일 전송하기..

  2. [linux] The Ultimate Wget Download Guide With 15 Awesome Examples

  3. [linux] vi 편집기 간단한 명령과 환경설정

  4. [linux] wget 명령 사용 예제

  5. [linux] Xwindow/Xmanager 사용

  6. [linux] X환경 GNOME에서 KDE로 바꾸는 법..

  7. [linux] yum 업데이트 시 커널 제외하기

  8. [linux] 간단한 find 명령어 설명(업데이트 해야 함)

  9. [linux] 간단한 NAT 설정 script

  10. [linux] 간단한 vi편집기 사용 명령

  11. [linux] 계정관리하기(내공쌓기)

  12. [linux] 기본 명령어 (내공쌓기)

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17