I have a script that I'm writing and I've set some flags using If statements. for example my flags are set as
flag=$(-a,-b,-c,-d)
and for example my If statement is set as
if echo "$flag" | grep -q -E -o "(-)(a)"; then
1
fi
my question is how do I add another if statement that will say if flag does not exist, then show an error. I've tried something like the following but it does not work.
if "[[ $flag"=="*" ]]; then
Error.
fi
Any suggestions? Thanks!