httpcode icon indicating copy to clipboard operation
httpcode copied to clipboard

README: Add quoting around brackets

Open xtaran opened this issue 4 years ago • 0 comments

Brackets are shell wildcard special characters and if there are no files 301 or 302 in the current directory, the command hc 30[12] will fail if e.g. bash's shell option failglob is set:

$  hc 30[12]
bash: no match: 30[12]

Even worse: Independent of that shell option this command will yield different outcomes depending which files or directories exist in the current directory:

$ hc 30[12]
Status code 301
Message: Moved Permanently
Code explanation: Object moved permanently -- see URI list

Status code 302
Message: Found
Code explanation: Object moved temporarily -- see URI list

$ touch 302
$ hc 30[12]
Status code 302
Message: Found
Code explanation: Object moved temporarily -- see URI list

$

The proper fix is to quote the argument containing the brackets.

xtaran avatar Aug 10 '22 12:08 xtaran