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: Dan Douglas
Subject: Re: [Help-bash] How to use alias defined in calling shell?
Date: Mon, 25 May 2015 06:27:08 -0500

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' )
+ eval 'declare -A BASH_ALIASES='\''([a]="echo the alias" )'\'''
++ declare -A 'BASH_ALIASES=([a]="echo the alias" )'
+ echo the alias
the alias

Or use a pipe, file, or parameter. Whatever is most appropriate.
Same applies to traps and functions. There's no point in
relying on bash's function export.

-- 
Dan Douglas



reply via email to

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