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: L A Walsh <cygwin at tlinx dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 24 Aug 2017 19:23:38 -0700
- Subject: Re: alias appears to not work inside a called bash script
- Authentication-results: sourceware.org; auth=none
- References: <40f2498d2efcf0f5214b476c80f9cb92@mail.kylheku.com>
Kaz Kylheku wrote:
There is an issue there (though not for the Cygwin project).
I don't see where ...
"expanding aliases in interactive mode, but ignoring them in
non-interactive
operation" [is required by POSIX].
POSIX seems to unequivocally be calling for Alias Expansion to occur
under all conditions.
Could you list the http reference for that?
And, indeed, this is not a bug in Bash; they know that this is
a POSIX deviation. Because, voila, aliases *are* expanded in
script mode if we do one of two things:
#!/bin/bash --posix
#!/bin/sh
----
Only in cygwin (4.4.12).
In my linux version of bash, expand_aliases is not turned on
in POSIX mode. Created scripts:
#!/bin/sh
shopt -s |grep expand
and
#!/bin/bash --posix
shopt -s |grep expand
On cygwin they show:
expand_aliases on
Not so on linux (same version of bash 4.4.12)
Hmmm...
Is there a definitive reference for this feature?
Thanks!
-l
--
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