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

Popular posts from this blog

c# - Highlight all words containing a letter in a richtextbox -

Admob interstitials not clickable on Nexus 5 (Android 4.4.2) -

java - MigLayout - selective component fill -