0 [: !=: unary operator expected In bash, always use the double bracket conditional command [[ ... ]] For example, #!/bin/bash sex=male if [[ $sex == 'male' ]];then echo "sex is male." elif [[ $sex == 'female' ]];then echo "sex is female." else echo "Invalid sex." fi terminal 15 linux 24 bash 18 shell 2 scripting 3 Please enable JavaScript to view the comments powered by Disqus.