Print text at specified line number bash -
I want to print text from a file to a specified line number.
Here's my bash script
line = 12 sed -n "$ line {p; q;}" Line number comes in one variable but the above code is not working What should I do?
You must give the filename as the argument of sed .
line = 12 sed -n "$ line {p; q;}" filename If you assign a file script to a single bidding script , You need to use:
line = 12 sed -n "$ line {p; q;}" "$ 1"
Comments
Post a Comment