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: Greg Wooledge
Subject: Re: How to automatically load alias from .bashrc in a bash script?
Date: Thu, 27 Oct 2011 12:43:27 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Oct 27, 2011 at 04:39:23PM +0000, Stephane CHAZELAS wrote:
> 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"

He'd still have to turn on the expand_aliases shell option in each
script, though.  Unless he puts it in .bashrc.

(Might as well hand him enough rope to hang himself.)

If you want to do things properly, use functions instead of aliases.
They are more powerful and more flexible.



reply via email to

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