Sunday, 20 February 2011

[: missing `]' +bash +shell scripts

 "=" sign requires a blank in front of it and after it. Otherwise, the bash only sees "something" within the brackets, and that is true (0), while "nothing" is false (1):

ex.
[ 5 = 6]
 
solution 
[ 5 = 6 ] 
 
 
Tutorials:
http://wiki.linuxquestions.org/wiki/Bash_tips
http://www.tldp.org/LDP/abs/html/
https://wiki.archlinux.org/index.php/Color_Bash_Prompt 

1 comment:

  1. Thanks , Helped me alot with my syntax!

    ReplyDelete