Re: "echo $((0x))" is accepted, treated as 0x0

Robert Elz <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
    Date:        Sat, 24 Jan 2026 18:57:35 +0100
    From:        Andreas =?utf-8?B?S8OkaMOkcmk=?= <[email protected]>
    Message-ID:  <[email protected]>

  | Well, it's at least consistent with
  |
  | 	$ declare -i v=
  | 	$ echo $v
  | 	0

Also an extension.   But that is consistent with the 100% posix

	v=
	echo $((v))

which also results in 0.

That is a slight extension of C expressions, but only because
vars valid in C espressions cannot have '' as their value (all
numeric or pointers).

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.