This question already has answers here:
Closed 10 months ago.
I want to loop over a file starting from the n th line using shell sed,I could make it work for an integer (example below starting from line 5), but I want to replace the integer by an sys argument variable : linesToBegin= $1
Here is the code:
sed -n '5,$ p' twitter_ids.txt | while read linecontent
do
echo $linecontent
done
When I replace the number 5 by linesToBegin:
sed -n '$linesToBegin,$ p' twitter_ids.txt | while read linecontent
I get an error saying
sed: -e expression #1, char 3: extra characters after comman