This repository was archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 709
Commit 5d7b6a6
authored
corrected string comparison, always use quotes
#24
https://unix.stackexchange.com/questions/131766/why-does-my-shell-script-choke-on-whitespace-or-other-special-characters
the linked issue failure corner case was when the output of command contained glob characters, for ex: `a[2]`
if string is unquoted on RHS of comparison operator, it is treated as glob comparison, not string comparison
hence why quotes are needed here1 parent d082d4e commit 5d7b6a6
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 | - | ||
46 | + | ||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
|
0 commit comments