You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] $UID, $EUID, $PPID, $SECONDS, $LINENO and $SHLVL expand to nothing, so [ "$UID" -eq 0 ] has no number to compare #367
Same as bash: six numbers in the brackets, then user, then i=3.
Actual Behavior
[][][][][][]
root
i=3
The variables are empty. On main an empty operand of -eq/-lt is read as 0 (#334), so the uid check says root for uid 1000.
Additional Context
Found while reviewing #348, which makes [/test reject an empty integer operand as bash does. With that PR the second command prints an integer expression expected error and user, and the third prints the error and i=0: the loop never runs. So once #334 is fixed, scripts that test these variables fail loudly instead of comparing against 0.
id -u prints 1000 and $$ expands in the same shell, so the values are available. $RANDOM is empty too and is covered by #275. $PPID and $LINENO are POSIX; the others are bash variables.
I ran debug builds through -c only and compared with bash 5.2.15. The first command gives the same output on main @ dbb6189 and on #348's head 9ef3e56.
Activity