From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25904 invoked from network); 15 Sep 1998 20:21:21 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Sep 1998 20:21:21 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id QAA20174; Tue, 15 Sep 1998 16:15:11 -0400 (EDT) Resent-Date: Tue, 15 Sep 1998 16:10:21 -0400 (EDT) Message-ID: <19980915151323.A5205@emsphone.com> Date: Tue, 15 Sep 1998 15:13:23 -0500 From: Dan Nelson To: Ken Lareau , zsh-users@math.gatech.edu Subject: Re: Simple way to get parent process name? References: <199809151847.OAA03970@mailhost2.squonk.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.2i In-Reply-To: <199809151847.OAA03970@mailhost2.squonk.net>; from "Ken Lareau" on Tue Sep 15 14:47:40 GMT 1998 X-OS: FreeBSD 2.2.7-STABLE Resent-Message-ID: <"Nr5ZX3.0.1u4.ici_r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1803 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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@emsphone.com