Contents of gaurav.txt file
$generalNetPath = "/net";
$generalNetPath = "/glbusers4/glb/aimsys/apxwrk48";
I trying to replace /glbusers4/glb/aimsys/apxwrk48 by pwd as follows
qaz=`pwd`
sed '/apxwrk/c\$generalNetPath = "$qaz";' gaurav.txt
I am getting the output as
$generalNetPath = "/net";
$generalNetPath = "$qaz";
I was expecting $qaz be replaced by my present working directory.As far as my knowledge this is happening because of ' (single quotes) that I am using.I have tried using \ before " but that didn't help.Is there any anyway can I do this.I mean can I use anything other than ' so that I can have value of $pwd replaced by using any character other than ' .I tried using | but didn't work.Please help me out with this.
$PWDvariable. – Stephane Chazelas Feb 15 at 17:41