apropos

What is the difference between alias and export (and a function!)[BASH]?

谁都会走 提交于 2019-12-29 06:55:23
问题 I'm surprised hasn't been asked before, but… What is the difference between alias ⇢ alias EXPORT='alias' function ⇢ function exporter() { echo $EXPORT } and export ⇢ export ALIAS='export' and for that matter... alias export=$(function) (j/k) in bash ( zsh , et al.) Specifically, I'd be most interested in knowing the lexical/practical difference between alias this=that and export that=this I have both forms ... all over the place - and would prefer to stop arbitrarily choosing one, over the

What is the difference between alias and export (and a function!)[BASH]?

对着背影说爱祢 提交于 2019-11-29 06:52:44
I'm surprised hasn't been asked before, but… What is the difference between alias ⇢ alias EXPORT='alias' function ⇢ function exporter() { echo $EXPORT } and export ⇢ export ALIAS='export' and for that matter... alias export=$(function) (j/k) in bash ( zsh , et al.) Specifically, I'd be most interested in knowing the lexical/practical difference between alias this=that and export that=this I have both forms ... all over the place - and would prefer to stop arbitrarily choosing one, over the other. 😂 I'm sure there is a great reference to a "scopes and use-cases for unix shells", somewhere...