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: Dennis Williamson
Subject: Re: [Help-bash] How to use alias defined in calling shell?
Date: Sun, 24 May 2015 22:48:55 -0500

On Sat, May 23, 2015 at 8:15 AM, Eduardo A. Bustamante López <
address@hidden> wrote:

> On Fri, May 22, 2015 at 05:45:29PM -0500, Peng Yu wrote:
> > In a bash script, I want to use an alias defined in the shell calling
> > in this script? Is it possible? Thanks.
> No, aliases are not exported. You'll have to define them in the script,
> and use
> the 'expand_aliases' shopt.
>
> --
> Eduardo Bustamante
> https://dualbus.me/
>
>
Tha Bash Manual states "For almost every purpose, shell functions are
preferred over aliases."

So use a function and export it.

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

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