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
Usage:
naval_fate.py a <name>...
naval_fate.py b -- <name>...
The following commands are faling regardless of single-quotes (') or double-quotes ("):
a "-a"
a "--a"
a '-a'
a '--a'
And these are correct regardless of the quotes and the number of dashes:
a "-"
a " -a"
a -- "-a" # parsed as two parameter
a -- "-b" # parsed as one parameter
In the docs there is a section about double dash -- which can be used to "separate options and positional arguments". I can use that to avoid this as you can see the second usage pattern of the example.
I don't think it is intended behaviour but I can be wrong.
Enclosing characters in single quotes (‘'’) preserves the literal value of each character within the quotes.
Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’, and, when history expansion is enabled, ‘!’.
Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to preserve the literal meaning of the special characters in the next paragraph, prevent reserved words from being recognized as such, and prevent parameter expansion and command substitution within here-document processing [...]
The text was updated successfully, but these errors were encountered:
Given the following doc:
The following commands are faling regardless of single-quotes (
'
) or double-quotes ("
):And these are correct regardless of the quotes and the number of dashes:
In the docs there is a section about double dash
--
which can be used to "separate options and positional arguments". I can use that to avoid this as you can see the second usage pattern of the example.I don't think it is intended behaviour but I can be wrong.
According to https://www.gnu.org/software/bash/manual/bash.html#Quoting
A could only find this in the IEEE Std 1003.1-2017 specs https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02
The text was updated successfully, but these errors were encountered: