Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While running a bash script, I get this error:

 sh: [[: not found

How can I find what where is the problem?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

[[ is a bash command that is not compatible with sh. Run the script with bash instead:

$ bash ./script.sh

Or edit the shebang:

#!/usr/bin/env bash

then:

$ ./script.sh
share|improve this answer
1  
Or put #!/usr/bin/env bash at the top of your script. –  Dean Nov 4 '13 at 21:20
add comment

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.