Problem finding variable data
varld=abc
sed -n -e '/$varld/! w dummy4.txt' -e '/$varld/{:a;n;w dummy5.txt' -e 'ba}' dummy3.txt
The instruction above cannot fine the 'abc' in varld. If I hard code the 'abc' into the instruction, as below, it works.
sed -n -e '/abc/! w dummy4.txt' -e '/abc/{:a;n;w dummy5.txt' -e 'ba}' dummy3.txt
Can someone tell me how to get the sed to find and use the data in $varld?
Thanks.
|