In bash, I defined a variable n, from which value of line number to the last line is what I am going to delete.
I tried
sed -i '${n},$d' file
but the error msg is:
sed: -e expression #1, char 5: extra characters after command
Any thoughts about how to correct the use of sed? I suspect it is because of two $ in the sed, one is for variable, the other is for the last line number.