Gossamer Forum
Home : General : Chit Chat :

sed question

Quote Reply
sed question
$ abc=`grep -n '^LETTERS' file.txt | awk -F: '{print $1}'`
$ echo $abc
10

To print from line 10 to the end of the file:
$ sed -n '10,$p' file.txt

How do I add this to my script because this does not work.

$ sed -n '$abc',$p' file.txt

Any help will be appreciated.

Thanks!
Quote Reply
Re: [narsman] sed question In reply to
Whats 'sed'?

I would use;

Code:
my $output = `tail -n20 -f file.txt`;

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [narsman] sed question In reply to
These examples may help...

http://www-h.eng.cam.ac.uk/help/tpl/unix/sed.html

Last edited by:

B::Parse: Aug 15, 2004, 5:33 PM
Quote Reply
Re: [B::Parse] sed question In reply to
Thanks, guys!