Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: wright@mdcbbs.com
Subject: getopt command for sh5
Date: 18 Jan 90 16:26:14 GMT	[thread overview]
Message-ID: <657.25b5ee26@mdcbbs.com> (raw)

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	 |   	                                   |
    +----------------------------+-----------------------------------------+


                 reply	other threads:[~1990-01-18 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox