I could use a little help with my IF and && statement. It's not working and nothing I'm trying is working either. Maybe someone can see the issue:
if [[ $thisvariable="yes" && grep 'this string' ./"$thisfile".txt ]]; then
This just doesn't work. Does anyone see an issue?
Try this:
I'm just now seeing the last post, so I didn't try that. I finally got it to work with this:
The
[
construct cannot take multiple conditions. What you are attempting can be written in multiple ways:or, more simply
From: http://tldp.org/LDP/abs/html/comparison-ops.html#SCOMPARISON1
Caution!, note the whitespace framing the "=".