回复: Possible bug in bash

2023-01-16 Thread anonymous4feedb...@outlook.com
ar al for foo in v do echo foo=$foo bar=$bar done $ bash ./test foo=v bar= $ bash --posix ./test foo= bar=v 发件人: Chet Ramey<mailto:chet.ra...@case.edu> 发送时间: 2023年1月17日 3:41 收件人: anonymous4feedb...@outlook.com<mailto:anonymous4feedb...@outlook.com>; bug-bash@gnu.org<mailto:b

Possible bug in bash

2023-01-15 Thread anonymous4feedb...@outlook.com
For the follow script alias al=' ' alias foo=bar al for foo in v do echo foo=$foo bar=$bar done bash (version 5.1.16) prints foo=v bar=, while all other shells I tested (dash, ksh, zsh, and yash) all prints foo= bar=v. Apparently bash substitutes foo for bar in line 3 because the previous alias al

Next word of alias to alias that end with is not checked for alias

2023-01-12 Thread anonymous4feedb...@outlook.com
Dear dir or madam, For the following script: alias a1='echo ' alias a2=a1 alias foo=bar a2 foo bash outputs ‘foo’, instead of ‘bar’. GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) on archlinux as windows subsystem for linux Thanks.