Forcing /bin/sh in a script under V/386 3.2 Korn shell

Bob McGowen x922-4312 Training bob at wyse.wyse.com
Tue Jul 25 10:06:23 AEST 1989


In article <799 at jonlab.UUCP> jon at jonlab.UUCP (Jon H. LaBadie) writes:
>In article <2318 at wyse.wyse.com>, bob at wyse.wyse.com writes:
>	... Much deleted ...
>> 
---more delted---
>Now a question for Bob.  Can you let me know the need for the
>
>	`whence $0`
>
>construction in your solution.  On inspection, it seems that $0 would
>be sufficient as the script was invoked that way to begin with.  But
>I am certain I am overlooking some subtle situation in which that
>is not the case.
>-- 
>Jon LaBadie
>{att, princeton, bcr}!jonlab!jon
>{att, attmail, bcr}!auxnj!jon

In my experience, when you invoke the Bourne shell on the command line
to run a script, the PATH is not consulted.  For example, _cx_, which
is in my personnal bin, which is part of my path, will generate the
error:
	cx: cx: cannot open
when I run it via:
	sh cx

I wanted to generate the absolute pathname of the script so I could
give it to sh to run, thereby guaranteeing(sp?) that sh would find
the script.

This may of course not be the case with all versions of sh.  My
experience is with XENIX and SUN versions (I can get at these
right now:-)

Bob McGowan  (standard disclaimer, these are my own ...)
Customer Education, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.questions mailing list