Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Martijn Dekker 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: References: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:15807 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