I am using this command to copy certain line from one file to another.Its working fine.No issue with it.
sed -f <(sed -e '1,10d; 12,$d; x; s/.*/10a\/;p; x' ../log/file2.txt ) ../log/file4.txt > ../log/file5.txt
The problem is instead of 10, I want to use variable VAR1 (where var1=10). The $VAR1 is not working.
I tried this command:
sed -f <(sed -e '1,$VAR1d; 12,$d; x; s/.*/10a\/;p; x' ../log/file2.txt ) ../log/file4.txt > ../log/file5.txt
Please help me.