Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15807

temp setting POSIXLY_CORRECT turns alias expansion off

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Martijn Dekker <martijn@inlv.org>
Newsgroups gnu.bash.bug
Subject temp setting POSIXLY_CORRECT turns alias expansion off
Date Thu, 16 Jan 2020 04:24:40 +0100
Lines 21
Approved bug-bash@gnu.org
Message-ID <mailman.2684.1579145088.1979.bug-bash@gnu.org> (permalink)
References <e9ec694f-aba2-1143-aa93-182ec2f85b8d@inlv.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1579145089 31352 209.51.188.17 (16 Jan 2020 03:24:49 GMT)
X-Complaints-To action@cs.stanford.edu
To Bug reports for the GNU Bourne Again SHell <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
Content-Language en-GB
X-detected-operating-system by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From 37.59.109.123
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <e9ec694f-aba2-1143-aa93-182ec2f85b8d@inlv.org>
Xref csiph.com gnu.bash.bug:15807

Show key headers only | View raw


When alias expansion is enabled for a script in bash native mode, 
prefixing POSIXLY_CORRECT=y to any command will turn alias expansion 
globally off. This is a bug because the assignment should only have 
effect on that command.

$ bash -c 'shopt -s expand_aliases; shopt|grep expand_a;
   POSIXLY_CORRECT=y true; shopt|grep expand_a'
expand_aliases 	on
expand_aliases 	off

Expected behaviour: alias expansion should stay on.

I've confirmed this bug on bash 4.2 and later; bash 4.1 and earlier seem 
fine.

- M.

-- 
modernish -- harness the shell
https://github.com/modernish/modernish

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

temp setting POSIXLY_CORRECT turns alias expansion off Martijn Dekker <martijn@inlv.org> - 2020-01-16 04:24 +0100

csiph-web