Contents

System/OS
2003.04.23 10:36

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

Views 13738 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 


?

List of Articles
No. Category Subject Author Date Views
142 System/OS [mac] 맥에서 기본 실행 앱 변경하기 file hooni 2018.03.02 1951
141 System/OS [mac] 맥에서 APM(apache,php,mysql) 구성하기 hooni 2013.04.23 38795
140 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4353
139 System/OS [mac] 맥(OSX)에서 root 패스워드 설정하기 hooni 2013.04.23 22586
138 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5172
137 System/OS [mac] VirtualBox 실행 스크립트와 bash_profile 설정 file hooni 2020.07.08 1166
136 System/OS [mac] SVN 1.8 업데이트 방법 hooni 2013.09.24 14693
135 System/OS [mac] OSX(맥) 단축키 설명 ㅎㅎ file hooni 2013.04.23 29644
134 System/OS [mac] OS X 요세미티 사용자가 많이 겪는 버그와 몇몇 불편사항 file hooni 2015.01.04 1665
133 System/OS [mac] OS X 엘 캐피탄에서 Soudflower 사용하기 2 file hooni 2016.10.03 1157
132 System/OS [mac] Mac에서 Mac으로 원격제어하기 (맥에서 맥으로) file hooni 2013.10.08 37239
131 System/OS [mac] Mac OS에서 재생되는 사운드를 녹음하는 방법 file hooni 2016.10.03 1728
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17