I want to print a text file from
X line number to
Y line number
The value of
Y is determined by searching for a specific line in the text file(in this case the page number)
I search for the line by the following command
echo -n |grep -nr "Page # 2" FileName.txt |cut -f1 -d: ; echo -n |grep -nr "Page # 3" FileName.txt |cut -f1 -d:
for which I get an out put
I want to feed this output to the command below
sed -n 'X,Yp' FileName.txt
But I get them as two different lines how can i feed it to the
There after I want to feed the result of the above command to the
lp command something like this...
sed -n 'X,Yp' FileName.txt | lp -dmyprinter
Can this be done without creating a file?