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


Groups > gnu.bash.bug > #15807 > unrolled thread

temp setting POSIXLY_CORRECT turns alias expansion off

Started byMartijn Dekker <martijn@inlv.org>
First post2020-01-16 04:24 +0100
Last post2020-01-16 04:24 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#15807 — temp setting POSIXLY_CORRECT turns alias expansion off

FromMartijn Dekker <martijn@inlv.org>
Date2020-01-16 04:24 +0100
Subjecttemp setting POSIXLY_CORRECT turns alias expansion off
Message-ID<mailman.2684.1579145088.1979.bug-bash@gnu.org>
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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web