csh, tcsh

Jmnote (토론 | 기여)님의 2015년 2월 25일 (수) 22:54 판 (→‎비교 예시)

C shell; csh
C쉘, C 셸
tcsh
tc쉘

1 csh

  • 빌 조이가 개발한 유닉스용 셸
  • C 언어를 전신으로 하여 만들어짐
  • 라이선스: BSD 라이선스

 

2 tcsh

3 본쉘과 비교 예시

sh csh
#!/bin/sh
if [ $days -gt 365 ]; then
   echo This is over a year.
fi
#!/bin/csh
if ( $days > 365 ) then
   echo This is over a year.
endif
#!/bin/sh
i=2
j=1
while [ $j -le 10 ]; do
   echo '2 **' $j = $i
   i=`expr $i '*' 2`
   j=`expr $j + 1`
done
#!/bin/csh
set i = 2
set j = 1
while ( $j <= 10 )
   echo '2 **' $j = $i
   @ i *= 2
   @ j++
end
#!/bin/sh
for i in d*
do
   case $i in
      d?) echo $i is short ;;
      *) echo $i is long ;;
   esac
done
#!/bin/csh
foreach i ( d* )
   switch ( $i )
      case d?:
         echo $i is short
         breaksw
      default:
         echo $i is long
   endsw
end

4 같이 보기

5 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}