Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I want to check input arguments on not on a bash script on OSX. I do:

if [-z "$1"]

I get:

/usr/local/bin/deploy.sh: line 8: [-z: command not found

Any tips?

Thanks.

share|improve this question
    
check this answer – Christos Papoulas Sep 8 '13 at 10:54
    
possible duplicate of "Command not found" when attempting integer equality in bash – chepner Sep 8 '13 at 13:29

1 Answer 1

You need a space around the condition:

if [ -z "$1" ]

    ^       ^
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.