sed block search with variables
Hi Folks,
1) extracting a block of text from file1 to file2 works fine this hardcoded way:
sed -n '/DW/,/;/p' file1.tmp > file2.tmp
2) Now I need it more flexible using a shell variable:
p=DW
sed -n '/$p/,/;/p' file1.tmp > file2.tmp
But the file2.tmp stays empty. What is wrong ? Thank you all.
|