From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21606 invoked from network); 13 Jan 1999 10:28:41 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Jan 1999 10:28:41 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id FAA27803; Wed, 13 Jan 1999 05:26:59 -0500 (EST) Resent-Date: Wed, 13 Jan 1999 05:26:59 -0500 (EST) Message-ID: <19990113102626.A6200@fysh.org> Date: Wed, 13 Jan 1999 10:26:26 +0000 From: Phil Pennock To: Zsh Development Workers Subject: How sensible is ... ? Mail-Followup-To: Zsh Development Workers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.2 Organisation: Organisation? Here? No, over there ----> X-Disclaimer: Any views expressed in this message, where not explicitly attributed otherwise, are mine and mine alone. Such views do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. Resent-Message-ID: <"ZuGPd2.0.Jo6.pJ7ds"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4894 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu How good an idea would it be to add a shell-callable context builtin, or a shell variable, to tell whether something is being run directly or as a function call? (I could be displaying ignorance of something that's already there, I suppose) Eg, have a directory of zsh scripts, which start: #!/bin/zsh -f case $context in toplevel) alias leave=exit ;; function) alias leave=return ;; esac the scripts could then be written such that zsh users could autoload them and others could run them and get the same effective results. These would of course be tricky, but I feel potentially more useful for system administrators who want to provide a bunch of small fast utilities for ALL users. I don't particularly want to have to litter a directory with 5-line scripts which always require fork-exec, I'd rather have a special directory containing files as per above and have the relevant system initialisation scripts sort out which PATH/FPATH it should go in. Feedback welcome -- --> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+ G+ e+ h* r y?