help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Context sensitivity of the word "parameter" in the section of "Parameter


From: Peng Yu
Subject: Context sensitivity of the word "parameter" in the section of "Parameter Expansion"
Date: Sun, 9 May 2021 10:59:54 -0500

Hi,

In the following paragraph in the manual, "parameter" in
"${parameter}" could be "!".

"""
       ${parameter}
              The value of parameter is substituted.  ...
"""

However, "parameter" in "${#parameter}" can not be "!".

"""
       ${#parameter}
              Parameter length. ...
"""

$ echo "${!}"
57766
$ echo "${#!}"
-bash: !}: event not found

So the word "parameter" in "${parameter}" and "${#parameter}" is not
the exactly same. Should this be made clearer in the manual?

I have not checked "parameter" in all the cases in this section. But I
guess the word "parameter" in the whole section should be check for
ambiguity like this?

This sentence is also not precise. ${!} obviously satisfies that the
first character is "!" and it is not a nameref. Yet ${!} is just the
process ID instead of a level of indirection.

"       If the first character of parameter is an exclamation  point  (!),  and
       parameter is not a nameref, it introduces a level of indirection."

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]