2007年7月4日 星期三

shell script : function

[will@localhost ShellScript]$ cat function.sh


#!/bin/sh

function printit(){

echo "Your choice is $1"

}

case $1 in

"one")

printit 1
;;
"two")
printit 2
;;
"three")
printit 3
;;
*)
echo "Usage {one|two|three}"
;;


esac

[will@localhost ShellScript]$

沒有留言:

網誌存檔

關於我自己