if conditional in bash giving error
I have a small bash script where I want to get the format of a file.
FILENAME=$1
GET_FILE_FORMAT=`file $FILENAME | grep -i data`
if[[ "$GET_FILE_FORMAT" = *data* ]]
echo "Format Data";
fi
However the output that I get is as follows
./try.bash test.data
./try.bash: line 4: if[[ test.data : data = *data* ]]: No such file or
directory
Format Data
./try.bash: line 6: syntax error near unexpected token `fi'
./try.bash: line 6: `fi'
No comments:
Post a Comment