This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: alias appears to not work inside a called bash script
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Tue, 22 Aug 2017 10:47:37 -0400
- Subject: Re: alias appears to not work inside a called bash script
- Authentication-results: sourceware.org; auth=none
- References: <000001d31acd$108b0340$31a109c0$@rogers.com> <CANnLRdgWnygyp36uYmpzq7i3BvgHonL5H8CPy_Vr+wOYmWjp4w@mail.gmail.com>
- Reply-to: moss at cs dot umass dot edu
On 8/22/2017 10:31 AM, Stephen John Smoogen wrote:
I replicated this problem on my system and found that the fix is to add a
shopt -s expand_aliases
at the top of the script. I don't know why the option is turned off
when running scripts versus in a plain script but that seems to be a
default in Cygwin.
It's a *bash* default - it has nothing to do with Cygwin as distinct
from other bash installations. If you had a different experience
elsewhere, it could be that the default was overridden in some system
wide bashrc file - but that strikes me as unlikely. I suspect that
this is done as a security measure, to prevent an alias from introducing
a surprise.
Regards - EM
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple