ash history using stderr instead of stdout
Package Information
- Package name: busybox
- Package version: busybox-1.37.0-r8
- Alpine version: 3.21.0
- Alpine architecture: x86_64
Summary
In Alpine 3.20, ash history
built-in seems to use stdout:
alpine:~# cat /etc/alpine-release
3.20.2
alpine:~# history 2>/dev/null | wc -l
26
alpine:~# history 2>&1 >/dev/null | wc -l
0
And in 3.21, it now seems to use stderr:
charm:~# cat /etc/alpine-release
3.21.0
charm:~# history 2>/dev/null | wc -l
0
charm:~# history 2>&1 >/dev/null | wc -l
2155
It's unclear to me whether this behaviour change is intentional; and I don't know if anyone is depending on the old behaviour. But it seems a bit inconvenient to have to redirect stderr to stdout just to have to grep through history, eg:
history 2>&1 | grep foo
I combed through the history for this package and found
which is the only thing I can see recently that mentions stderr specifically. It may be related, but I didn't dig too deeply to confirm.
Edited by Tyler Mitchell