Skip to content

Conversation

@TomMD
Copy link
Contributor

@TomMD TomMD commented Aug 4, 2020

Shellcheck tells us "-n doesn't work with unquoted arguments. quote or use [[ ]]."

And testing shows:

docker run --rm -it ubuntu bash
root@fe85ce156856:/# [ -n $DOES_NOT_EXIST ] && echo "I ran"
I ran
root@fe85ce156856:/# [ -n "$DOES_NOT_EXIST" ] && echo "I ran"
root@fe85ce156856:/#

Shellcheck tells us "-n doesn't work with unquoted arguments. quote or use [[ ]]."

And testing shows:

```
docker run --rm -it ubuntu bash
root@fe85ce156856:/# [ -n $DOES_NOT_EXIST ] && echo "I ran"
I ran
root@fe85ce156856:/# [ -n "$DOES_NOT_EXIST" ] && echo "I ran"
root@fe85ce156856:/#
```
@bagder
Copy link
Member

bagder commented Aug 4, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants