title: How to grep an empty string?
body: <p>I would like to grep for "String = " and when nothing is mentioned...when it's empty...echo with an if then else statement:</p>
  
  <p>I tried something like that:</p>
  
  <pre><code>if grep "String" input.txt | sed -e 's/    String = //g' | egrep -q "^$"
  then
  &lt;command&gt; &gt; output.txt
  else
  echo "--" &gt; output.txt
  fi
  </code></pre>
  
  <p>When I use the sed command the line is empty.</p>
  
  <p>Thx in advance!</p>
  
  <p><strong>UPDATE</strong>
  these are some possible lines in input.txt</p>
  
  <pre><code>String = TextA
  String = 
  String = TextB
  </code></pre>