bug-bash
[Top][All Lists]
Advanced

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

Re: how are aliases exported?


From: Dennis Williamson
Subject: Re: how are aliases exported?
Date: Fri, 13 Apr 2012 19:20:19 -0500

Aliases are intended for command line convenience. You should use
functions, which can be exported and are the correct thing to use in
scripts (and even from the command line).

"For almost every purpose, shell functions are preferred over aliases."

But, of course, you know that already.

On Apr 13, 2012 7:01 PM, "Linda Walsh" <bash@tlinx.org> wrote:
>
>
>
>
>
> How can I export an alias so it survives across an exec?
>
>
> I thought there was a way for them to be exported like vars or
functions...
> but neither work.
>
> I have a prog that needs an alias defined, if it isn't, it
> execs a program to define the alias which re-execs the first --
> if the alias isn't defined on the 2nd execution, the program
> fails (has a check to prevent looping)...it seems the alias isn't
> staying defined across the exec....
>
> shouldn't export -f work for aliases? -- as I don't think
> it would work to have an alias the same name as a function
> (or would it?....)  Either way.. How can you export an alias - simply!
>
> I mean I could do it by re-instantiating them in a bash_env file, like
> I have to do for arrays -- is the same required for aliases?    Both
> are pretty ugly though...
>
>
>
>


reply via email to

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