[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $((expr)) allows the hexadecimal constant "0x"
From: |
Steffen Nurpmeso |
Subject: |
Re: $((expr)) allows the hexadecimal constant "0x" |
Date: |
Mon, 11 Dec 2023 20:19:21 +0100 |
User-agent: |
s-nail v14.9.24-574-g9ad6cbbd93 |
Chet Ramey wrote in
<a7061869-4887-4c9b-9684-03c21fdb4030@case.edu>:
...
|It's still accepted in the devel branch, unless STRICT_ARITH_PARSING is
|defined. There was a discussion about it in 2022:
|
|https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00045.html
You surely mean
https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00065.html
and especially
https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00073.html
(which quotes)
The 0x (or 0X) prefix in base 16 is optional so only skip over the
prefix if the character following it is a valid hex char. The C99
standard is clear that given the string "0xy" zero should be returned
and endptr set to point to the "x"
though my "advise" is shows my bash geek status is much weaker
compared to what Greg Wooledge posted, referring to a much earlier
discussion that i was unaware of.
Sadly i keep
jobs_selection ()
{
local j= a=${AWK:-awk};
[ $# -gt 0 ] && j='&& $2 !~ /(^| )('$(echo "$@" | tr ' ' '|')')( |$)/';
j=$(jobs -l | $a -F '[][]' '/^[[]/'"$j"'{print "%" $2}{next}');
echo $j
}
$ alias j-
alias j-='jobs_selection'
for "kill $(j-)" around.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
|
| Only in December: lightful Dubai COP28 Narendra Modi quote:
| A small part of humanity has ruthlessly exploited nature.
| But the entire humanity is bearing the cost of it,
| especially the inhabitants of the Global South.
| The selfishness of a few will lead the world into darkness,
| not just for themselves but for the entire world.
| [Christians might think of Revelation 11:18
| The nations were angry, and your wrath has come[.]
| [.]for destroying those who destroy the earth.
| But i find the above more kind, and much friendlier]
- Re: $((expr)) allows the hexadecimal constant "0x", (continued)
Re: $((expr)) allows the hexadecimal constant "0x", Chet Ramey, 2023/12/11
Re: $((expr)) allows the hexadecimal constant "0x", Chet Ramey, 2023/12/11
Re: $((expr)) allows the hexadecimal constant "0x", Chet Ramey, 2023/12/10
Re: $((expr)) allows the hexadecimal constant "0x", Chet Ramey, 2023/12/10
Re: $((expr)) allows the hexadecimal constant "0x", Martin D Kealey, 2023/12/11