In bash, I'm trying to grep a file for a line beginning with a \, and return the result using backticks.
For example:
echo \\Hello > myFile out=`cat myFile | grep '^\\Hello'` echo $out returns nothing, even though
cat myFile | grep '^\\Hello' returns, as epected.
\Hello This seems extremely odd shell behavior. In particular, the anologous command sequence in tcsh does what one would expect:
set out=`cat myFile | grep '^\\Hello'`; echo $out returns
\Hello Could somebody explain what's going on please? Thanks