Category: Bash

Gnu-bash-logo 0

[: !=: unary operator expected

In bash, always use the dou­ble bracket con­di­tional com­mand [[ … ]] For exam­ple, #!/bin/bash sex=male if [[ $sex == ‘male’ ]];then echo “sex is male.” elif [[ $sex == ‘female’ ]];then echo “sex…