bashrc if: Expression Syntax error bashrc if: Expression Syntax error unix unix

bashrc if: Expression Syntax error


if: Expression Syntax 

is not an error bash would give you. Perhaps your shell is not bash. In fact, as long as if stands alone, any error would not be with if itself:

$ if [somethingswrong]; then fail; fi # error, then `[` command must have space around it.-bash: [somethingswrong]: command not found

You can check your shell by echoing $SHELL, and you can check which version of bash with $BASH_VERSION. (If the latter is unset, your shell is not bash.)