Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Simple way to get parent process name?



In the last episode (Sep 15), Ken Lareau said:
> At my current job I compile a lot of various packages, and tend to
> log my configuration, compilation and installation procedures for
> future reference, using the 'script' command.  To keep myself from
> getting confused as to whether I was in a 'script' process or not, I
> would have the shell prompt change to something else while running
> 'script'.

How about

script () { 
  export INSCRIPT 
  (( INSCRIPT ++ )) 
  command script "$@"
  (( INSCRIPT -- ))
}

then when you set your prompt, test to see if $INSCRIPT is > 0.

There's no portable way to find the parent's process name, as far as I
know.

	-Dan Nelson
	dnelson@xxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author