[Info-vax] Foreign commands ... newbie question
Johnny Billquist
bqt at softjar.se
Tue Oct 18 11:18:48 EDT 2011
On 2011-10-18 15.50, Bob Koehler wrote:
> In article<j7ic30$f0d$2 at Iltempo.Update.UU.SE>, Johnny Billquist<bqt at softjar.se> writes:
>>
>> The problem that sh and descendants don't have a built-in which. An
>> external which can never see aliases (obviously), since that isn't
>> visible outside the running shell process.
>
> Not obvious, since child processes often inherit the shell symbols
> of thier parent. So a shell process starting a separate which is
> likley to pass the existing value of aliases to the process running
> which.
By "inherit shell symbols" I assume you mean the environment variables?
Local shell symbols are not inherited. They are (as the name implies) local.
bash have a trick, where functions can be placed in environment
variables, and thereby be inherited by subshells. (I think I've only
seen that in bash, but perhaps others do a similar trick.)
Johnny
More information about the Info-vax
mailing list