Contents

System/OS
2003.04.23 10:36

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

조회 수 13698 댓글 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] 콘솔/Xwindow 에서 PC스피커 소리 없애기

  2. [linux] 패킷 스니퍼링

  3. [windows] 원격 데스크탑(터미널 서비스) 포트 변경

  4. [owasp] 10대 웹어플리케이션 보안 취약

  5. 라우팅 경로 결정 영향 요소 ㅋㅋ

  6. [router] 설정과 기본 명령어들 모음

  7. [linux] 쉘스크립트 expr

  8. [linux] 종료와 종료코드 확인(환경변수에서)

  9. [linux] 특수문자 환경 설정(stty)

  10. [linux] apache, php, jsp 환경설정하기..

  11. [linux] 센드메일 동적릴레이 설치

  12. [linux] 아파치설치/설정 - 사용인증

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