URL: <https://savannah.gnu.org/bugs/?67723>
Summary: bash 5.3 breaks sourcing Linux sysfs uevent files
Group: The GNU Bourne-Again SHell
Submitter: mwilck
Submitted: Thu 20 Nov 2025 04:49:01 PM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 20 Nov 2025 04:49:01 PM UTC By: Martin Wilck <mwilck>
Linux uevent files contain lines in "VAR=value" style.
It's a common idiom under Linux to source uevent files with the shell and
print the value of some variable, like this:
# cat /sys/class/block/sda/uevent
MAJOR=8
MINOR=0
DEVNAME=sda
DEVTYPE=disk
DISKSEQ=1
# (. /sys/class/block/sda/uevent; echo "$DEVNAME")
sda
The expected output is "sda". This was the case with bash 5.2 and earlier
versions, and is also the case with other shells.
But with bash 5.3, an error is reported and the result is an empty string:
# (. /sys/class/block/sda/uevent; echo "$DEVNAME")
bash: /sys/class/block/sda/uevent: Success
The problem was introduced in b8c60bc ("Bash-5.3 distribution sources and
documentation")
The problem is co-caused by the fact that the Linux kernel reports a size of
4k for every regular file:
# stat -c %s /sys/class/block/sda/uevent
4096
However, this is a regression in bash.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67723>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
