edit file that invoked script while executing

Jay A. Konigsberg jak at sactoh0.UUCP
Sat Jul 14 05:25:49 AEST 1990


In article <18994 at well.sf.ca.us> gregs at well.sf.ca.us (Greg Strockbine) writes:
>What I'm looking for here is a general approach and a couple of
>specifics. 
>I have a bourne shell script that is invoked from within a 
>Makefile. How in the bourne shell can I get the userid of
>the person who inovked the make?

UID=`id | cut (some directives)` # is one way, there are others.

>I then want to locate the Makefile
Assuming nobody is using absolute path names or changing directories in
the code:

PATH=`pwd`

Otherwise, you'll need code in the Makefile that determins the PATH from
a shell command within make(1).

>				    and remove the dependency 
>from the 'all' target that caused the script to be invoked.

Well, I suppose sed/ed scripts would work, but I was always taught that
programs that change their own code was a bad idea. Instead, you set
flags that tell the code to skip sections.


-- 
-------------------------------------------------------------
Jay @ SAC-UNIX, Sacramento, Ca.   UUCP=...pacbell!sactoh0!jak
If something is worth doing, its worth doing correctly.



More information about the Comp.unix.questions mailing list