Hi all ,
Am trying to print the last n lines of a file using sed, but am unable to do a echo within sed. can someone correct me?
Code:
sed -n '1,40' linetest
is working
if n=40 (am got this from some other output)
I try to the following and failed.
Code:
sed -n '1,"/`echo $num`/"p' linetest
I want to print the first n lines only .I want a substitute for
Code:
head -`echo $num` linetest
using sed.
Thanks