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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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!