Professional Documents
Culture Documents
Content: - Shells and Shell Scripts - TCSH, Enhanced C-Shell - Bash, Bourne-Again Shell
Content: - Shells and Shell Scripts - TCSH, Enhanced C-Shell - Bash, Bourne-Again Shell
#!/bin/sh
# This is for Bourne Shell
<patter2>|<value2>)
command2
;;
esac
July 17, 2003 Serguei A. Mokhov, 27
mokhov@cs.concordia.ca
case (2)
case $# in
1) cat >> $1
;;
2) cat >>$2 <$1
;;
3) case $3 in
-[abc]) echo "-a -b or -c"
;;
-foo|-bar) echo "-foo or -bar"
;;
esac
;;
*) echo "we accept up to 3 args only."; exit 127
;;
esac
July 17, 2003 Serguei A. Mokhov, 28
mokhov@cs.concordia.ca
for
• Syntax:
for variable in <list of values/words>[;]
do
command1
command2
…
done