Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Simple way to get parent process name?
- X-seq: zsh-users 1803
- From: Dan Nelson <dnelson@xxxxxxxxxxxx>
- To: Ken Lareau <elessar@xxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Simple way to get parent process name?
- Date: Tue, 15 Sep 1998 15:13:23 -0500
- In-reply-to: <199809151847.OAA03970@xxxxxxxxxxxxxxxxxxxx>; from "Ken Lareau" on Tue Sep 15 14:47:40 GMT 1998
- References: <199809151847.OAA03970@xxxxxxxxxxxxxxxxxxxx>
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