I am having trouble passing this variable into sed in a bash script. I was able to successfully do the reverse of what I am asking (delete all lines prior to a specified line number) following this syntax.
sed "1,${line_number}d"
but trying to recreate a similar answer to delete all lines after a line number continuously gives me errors. I have tried follwing:
sed "${line_number},$d" #results in unexpected comma
sed "|${line_number}|,|$d|" #trying to use a separator gives me an error for missing command
I'm not sure why the first would work but the second one would not. Any help appreciated!