rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* No break or exit?
@ 1991-10-29  2:29 David J. Fiander
  0 siblings, 0 replies; only message in thread
From: David J. Fiander @ 1991-10-29  2:29 UTC (permalink / raw)
  To: rc

First, a side issue:  for the person that was wondering about
'echo =', I wrote to Tom Duff about this, because I wanted to
perform assignments on the make command line, and the yacc
grammar seemed to disallow this without quoting.  He responded
by saying that you do have to quote '=' which are not part of
temporary variable assignments.

Now the main attraction.

I know that Byron's rc has got break and exit commands, but how do
the V10 guys write their shell scripts?  The standard form for me
under the Bourne shell is

	set -- `getopts opt:s $*`
	for i
	do
		case $i in
		-o)	stuff
			;;
		-\?)	Usage
			exit 1
			;;
		--)	break;
		esac
	done

which is roughly translated into the following

	*=`{getopts opts $*}

	while (!~ $1 --) {
		switch ($1) {
		case -o
			stuff
		case '-?'
			Usage
			exit 1
		}
	}

So I can do without the 'break' statement in this case, but how
do you handle leaving the script early without the exit?

--
David J. Fiander   |"A 'alf a liter ain't enough.  It don't satisfy.
<david@golem.uucp> |And a 'ole liter's too much."


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-10-29  2:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-10-29  2:29 No break or exit? David J. Fiander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).