I want to use sed command to search lines by line number. I give the command:
#sed -n '3p;3q'
Now, I don't want to use the exact value. Instead, I want to use the values of line numbers by variables. I tried using above command but that's not working. What I exactly want:
#sed -n '$var p; $var q'
How will I able to use variables with above command?