I have an error that is hard to clear. All that is supposed to happen is to test two conditions and then do something. The goal is to is it is empty or if it's a match.
if [ -z "$_BRANCH" ] || [[ "$_BRANCH" = "master" ]]; then
_FOE_BRANCH="master"
[ -s "$module_dir/branch.gitploy" ] && _FOE_BRANCH=$(cat "$module_dir/branch.gitploy")
[ "$_FOE_BRANCH" -ne "master"] && _BRANCH=$_FOE_BRANCH
fi
for some reason I keep getting this error
[: missing `]'
for this line
if [ -z "$_BRANCH" ] || [[ "$_BRANCH" = "master" ]]; then
but as I read up to try to clear it I keep going in loops. I expected everything to be ok based on https://stackoverflow.com/a/16138899/746758 .
I wanted to head this off that I did look at the like posts and didn't post this with out many failed corrections, so as far as I see it atm, this is not a duplicate to Bash if statement [: missing `]' error or Brackets in if condition: why am I getting syntax errors without whitespace? , as far as I can tell there is no white space issue as they had in the answers. I believe I have a match on the lexicon and I would think it's a different issue and need a solution to it.
[]
there must be a space between each part. just my2cents form some one learning – Quantum Jan 20 '15 at 06:44