System/OS
2003.04.23 10:36
[linux] 셀 스크립트 if, for, case in..
조회 수 14493 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
168 | System/OS | [linux] awk 명령어 | hooni | 2014.03.11 | 5993 |
167 | System/OS | [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." | hooni | 2014.04.05 | 7346 |
166 | System/OS | [linux] CentOS 6.x Cati 설치 (yum) | hooni | 2014.01.17 | 49582 |
165 | System/OS | [linux] CentOS Apache Httpd에 https 적용 | hooni | 2014.03.05 | 5328 |
164 | System/OS | [linux] CentOS 에 APM 설치하기 | hooni | 2015.01.02 | 2974 |
163 | System/OS | [linux] CentOS 터미널 언어 설정(한글/영어) | hooni | 2013.12.22 | 19554 |
162 | System/OS | [linux] DHCP(Dynamic Host Configuration Protocol) 서버 | hooni | 2003.04.23 | 13738 |
161 | System/OS | [linux] DNS(Domain Name System) 설치, 설정 | hooni | 2003.04.23 | 13239 |
160 | System/OS |
[linux] GD 라이브러리 설치 방법..
![]() |
hooni | 2013.04.23 | 12360 |
159 | System/OS |
[linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기
![]() |
hooni | 2014.01.09 | 13428 |
158 | System/OS | [linux] ipchains 사용예(패킷 필터링) | hooni | 2003.04.23 | 15017 |
157 | System/OS | [linux] ipchains 옵션 | hooni | 2003.04.23 | 14446 |