bug-bash
[Top][All Lists]
Advanced

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

Re: How to automatically load alias from .bashrc in a bash script?


From: Stephane CHAZELAS
Subject: Re: How to automatically load alias from .bashrc in a bash script?
Date: Thu, 27 Oct 2011 16:39:23 +0000 (UTC)
User-agent: slrn/pre1.0.0-18 (Linux)

2011-10-27, 11:17(-05), Peng Yu:
> I want to use some alias in a bash script. But I have to include the
> following line in the script in order to use the alias defined in
> ~/.bashrc. Is there a way to automatically load the alias from .bashrc
> so that I don't have to explicitly include these two lines?
>
> shopt -s expand_aliases
> . ~/.bashrc

You mean you'd like every bash script you run on your system to
automatically source your ~/.bashrc.

That sounds like a very unwise thing to do to me,  but that
could be done with:

export BASH_ENV="$HOME/.bashrc"

-- 
Stephane
>
>




reply via email to

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