Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!rlgvax!cvl!umcp-cs!chris
From: chris@umcp-cs.UUCP
Newsgroups: net.unix
Subject: Re:  Shell programming style -- a plea for better shell scripts
Message-ID: <5588@umcp-cs.UUCP>
Date: Thu, 1-Mar-84 21:55:18 EST
Article-I.D.: umcp-cs.5588
Posted: Thu Mar  1 21:55:18 1984
Date-Received: Sat, 3-Mar-84 22:45:49 EST
References: <16945@sri-arpa.UUCP>
Organization: Univ. of Maryland, Computer Science Dept.
Lines: 23

One more note.  Apparently, someone is saying that "gee I want to
run the user's ``xyzzy'' program but the /bin ``test'' program",
and for that reason can't put

	#! /bin/sh
	PATH=/usr/bin:/bin

at the beginning of ``sh'' scripts.  Well don't despair, there is a
solution.  Try

	#! /bin/sh
	lpath=/usr/bin:/bin	# or whatever your shell script needs
	xyzzy			# use the user's xyzzy program
	PATH=$lpath if test ...	# don't use the user's test program

I can't say if it works on System III or System V, but it works under
4.1.  (I just tested it.)

Aren't "temporary environment variables" wonderful?
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris.umcp-cs@CSNet-Relay