From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9a857358923e954b,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1990-01-19 03:01:59 PST Path: gmdzi!unido!mcsun!uunet!mdcbbs!wright From: wright@mdcbbs.com Newsgroups: comp.sys.dec Subject: getopt command for sh5 Message-ID: <657.25b5ee26@mdcbbs.com> Date: 18 Jan 90 16:26:14 GMT Organization: McDonnell Douglas M&E, Cypress CA Posted: Thu Jan 18 17:26:14 1990 I am trying to do some script writing in sh5 and need some help with an embedded shell command... I am trying to parse out an argument from a command line into another script using the getopt command, here is what I have. I cannot get the argument to be recognized. set -- `getopt s: $ARGV` # put the arg "s" into the var ARGV for i in $ARGV do case $i in -s) CALLED=YES ; shift;; --) (echo "Invalid argument") ; break;; esac done The manual is very cryptic with this command and there are not very many sh5 experts around either. I recieved this script from a Sun system and it works fine in the following context: while getopt s ARGV do case $ARGV in s) CALLED=YES ;; \?) (echo "Invalid argument") ;; esac done I would like to find the appropriate sequence for this to complete my script. Thanks in advance... -- +----------------------------+-----------------------------------------+ | Dave Wright | Phone: (714) 952-6320 | | McDonnell Douglas M&E | Internet: wright@mdcbbs.com | | Software Engineering | UUCP: uunet!mdcbbs.com!wright | | P.O.Box 6011 | PSI: PSI%31060099980019::WRIGHT | | Cypress, Ca. 90630 | | +----------------------------+-----------------------------------------+