In sh, I know I can do something like the following...
#!/sbin/sh
case "$1" in
'foo')
/path/to/foo.sh
;;
'bar')
/path/to/bar.sh
;;
*)
echo $"Usage: $0 {foo|bar}"
exit 1
;;
esac
I've searched the entirety of the internets and can't seem to find a corresponding switch statement that matches what I'm trying to do above.
Before we get too much further; I know, I know, I shouldn't be using csh, but I have a legacy app that only runs in csh. I'm trying to build a Solaris SMF service for it and I've already tried setting the shell but whatever shell is used in the method file overwrites the actual SMF shell. So it has to be in csh.
Thanks in advance for any help provided.
tl;dr (How do you convert the above to csh?)
man csh
gives some reference material regardingcase
andswitch
. – Chris Davies Jul 05 '19 at 15:00...sorry I can't seem to format stuff in a comment.
– Trae McCombs Jul 05 '19 at 15:24