I've been trying to figure out how to copy lines from one file to the end of another using sed with some shell variables.
sed -n "$var1,$var2'p'" file1.txt > file2.txt
I've tried that and many close variations but no cigar. Could someone please enlighten me about the correct syntax? Thanks.
So I tried to suggestions below but now I get this error
sed: -e expression #1, char 2: invalid usage of line address 0 sed: -e expression #1, char 2: unknown command: `*'"
Ok these suggestions helped and I found another issue and now my script is running flawlessly. Thank you so much!