help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] How to use alias defined in calling shell?


From: Greg Wooledge
Subject: Re: [Help-bash] How to use alias defined in calling shell?
Date: Tue, 26 May 2015 08:17:32 -0400
User-agent: Mutt/1.4.2.3i

On Mon, May 25, 2015 at 06:27:08AM -0500, Dan Douglas wrote:
> I always suggest doing this manually.
> 
> $ ( shopt -s expand_aliases; alias a='echo the alias'; export BASHOPTS
> myAliases=$(typeset -p BASH_ALIASES); bash -xc $'eval "$myAliases"\n
> a' )

And I suggest not doing it at all.  How are you going to be able to trust
the script if it picks up random garbage from the caller and treats it
as code?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]