command line options

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Apr 25 02:16:40 AEST 1988


In article <1864 at sugar.UUCP> peter at sugar.UUCP (Peter da Silva) writes:
>Speaking of the bourne-again shell (System V shell), how do you get a shell
>function inherited by subshells?

In the 8th Edition UNIX shell, you simply export them via the environment.
In the BRL SVR2 Bourne shell, you define the functions in the per-
interactive-shell startup file named in the ENV environment variable
(the usual usage around here is to define ENV as ~/.env and have ~/.env
source a ~/.funcs file that contains the definitions).  Note that this
scheme prevents having functions screw up shell scripts (which are not
run as "interactive").
In a vanilla UNIX System V Bourne shell, you cannot obtain the desired
effect so far as I am aware.



More information about the Comp.unix.wizards mailing list