I have this code that outputs:
1: '[' '[' "" = "" ']'
2: script.sh: line 7: [: too many arguments
3: '[' '[' artifact1,artifact2,artifact3,artifact4,artifact5 = "" ']'
4: '[' '[' 2.14 = "" ']'
5: '[' '[' N = "" ']'
6: script.sh: line 7: [: too many arguments
Here is the part of the code:
set -x
NEW_TAG = "";
TAGS = artifact1,artifact2,artifact3,artifact4,artifact5;
VERSION = 2.14;
FIX = N;
if [ [ "$NEW_TAG" = "" ] || [ "$TAGS" = "" ] || [ "$VERSION" = "" ] || [ "$FIX" = "" ] ];
I have already put double quotes in the variables but still I encounter this error. What could have I done wrong?
Thanks in advance. Cheers!
[is actually an alias for thetestcommand. I recommend you read the manual page fortest.[is a command name, not a grouping operator.=:NEW_TAG=""(or justNEW_TAG=). Run your code through shellcheck.net to catch the more obvious errors.