My input file looks like this
abc def \ ghi jkl && mno || hju
to replace '\' with line 2
newLine=`sed -n "2 p" inputFile`
sed -n 's/\\/'"$newLine"'/p' inputFile | tee inputFile
When i do this, the output i get is ->
abc def abc def ghi jkl \\ mno || hju
but the output should have been
abc def abc def ghi jkl && mno || hju
Why is it that '&&' gets replaced by '\\' ?
Where could i be going wrong ?