From 943b6071f79fdc0f7dc42fe3d61a85f68e0d9c12 Mon Sep 17 00:00:00 2001 From: Michael Sobrepera Date: Sat, 19 Feb 2022 19:00:48 -0800 Subject: [PATCH] added a note on the importance of quoting for this application. --- SC2236.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SC2236.md b/SC2236.md index 0349b20..8191745 100644 --- a/SC2236.md +++ b/SC2236.md @@ -35,4 +35,5 @@ This is a stylistic issue that does not affect correctness. If you prefer the or ### Related resources: * Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc! -* [Bash reference manual for -z and -n](https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html#Bash-Conditional-Expressions). \ No newline at end of file +* [Bash reference manual for -z and -n](https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html#Bash-Conditional-Expressions). +* Note: Be careful with quoting variables (which you should always do anyway): `[ ! -z $var ]` might work, but `[ -n $var]` will not. `[ -n "$var" ]` will do what you expect. \ No newline at end of file