C 셸
| 원저자 | 빌 조이 |
|---|---|
| 발표일 | 1978년 0월 0일 |
| 안정화 버전 | 6.20.00
/ 2016년 11월 24일[1] |
| 저장소 | |
| 프로그래밍 언어 | C |
| 운영 체제 | BSD, 유닉스, 리눅스, OS X |
| 종류 | 유닉스 셸 |
| 라이선스 | BSD 라이선스 |
C 셸(C shell, csh)은 빌 조이가 개발한 유닉스용 셸로, 본 셸보다 한층 강력하고 사용하기 쉬운 셸이다.
csh는 기본적으로 C언어를 전신으로 하여 만들어졌으며 강력한 프로그램 작성 기능을 가지고 있어 C 셸이라 불리게 되었다. 대표적인 기능으로 히스토리, 별명, 작업 제어가 있다. 히스토리는 많은 개발자들에게 유용한 기능으로 과거에 사용한 명령어를 반복하거나 수정하기 매우 편리하다. 별명의 경우 자주 쓰는 긴 명령어를 짧게 사용할 수 있도록 도와주었으며, 작업 제어 기능은 프로세서에 우선순위를 두는 것으로 효율적인 작업이 가능하도록 하였다. 그러나 초기에는 버그가 많아 사용하기에 무리가 있었다.
예
- 식 연산자와 문법을 다루는 예
|
본 셸 #!/bin/sh
if [ $days -gt 365 ]
then
echo This is over a year.
fi
|
C 셸 #!/bin/csh
if ( $days > 365 ) then
echo This is over a year.
endif
|
- 2의 10제곱
|
본 셸 #!/bin/sh
i=2
j=1
while [ $j -le 10 ]
do
echo '2 **' $j = $i
i=`expr $i '*' 2`
j=`expr $j + 1`
done
|
C 셸 #!/bin/csh
set i = 2
set j = 1
while ( $j <= 10 )
echo '2 **' $j = $i
@ i *= 2
@ j++
end
|
- switch 문의 예
|
본 셸 #!/bin/sh
for i in d*
do
case $i in
d?) echo $i is short ;;
*) echo $i is long ;;
esac
done
|
C 셸 #!/bin/csh
foreach i ( d* )
switch ( $i )
case d?:
echo $i is short
breaksw
default:
echo $i is long
endsw
end
|
같이 보기
각주
- ↑ Zoulas, Christos (2016년 11월 24일). “tcsh-6.20.00 is now available!”. 《mx.gw.com》. 2016년 11월 25일에 원본 문서에서 보존된 문서. 2016년 11월 24일에 확인함.
| 이 글은 운영체제에 관한 토막글입니다. 여러분의 지식으로 알차게 문서를 완성해 갑시다. |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.