PDA

View Full Version : Some question for shell programming



cs_yckad
17th September 2004, 04:42 AM
I want to write some script where support different [OPTION]

for example :
MYSHELL -l
MYSHELL -A
MYSHELL -l -A

but i dont want to use "case " to handle it ,
case "$1"
-l) somethin script
case "$2")
-A) XXXXX
;;
esac
;;
-A) other script
;;
esac

imdeemvp
17th September 2004, 05:01 AM
pardon my answer, will this be the right forum for this? but maybe ghaefb can help you!

tashirosgt
17th September 2004, 03:26 PM
Perhaps you could state the specific purpose of the script. The question is not clear. You can implement decisions in various ways: case, or if ...fi , or pass the option as an option when your script calls another script. But which is better design probably depends on what you want the script to do.

olivierv
17th September 2004, 03:39 PM
Ok, you got me... I'm curious as to why you don't want to use the CASE statement...