Contents

System/OS
2003.04.23 10:36

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

Views 14493 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
스크립트   인수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] split 명령어

  2. [linux] SSH에 대한 기본 설명과 설치/설정

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

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

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

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

  7. [linux] Xwindow/Xmanager 사용

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

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

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

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

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

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