[Nolug] sed question

From: David John <djohn_at_archdiocese-no.org>
Date: Mon, 20 Nov 2006 22:17:00 GMT
Message-Id: <200611201617718.SM03300@[206.41.39.59]>

Hello List,

I’m using GNU sed version 4.1.4.
Let’s say I have a file.txt that contains:
@@1234@@ -- abcd

All I want is whatever is between the “@@”, e.g. 1234; the rest can be discarded.

If I do:
grep "@@" file.txt | tail -1 | sed -e 's/@@//' -e 's/@@//'
it returns:
1234 – abcd

What’s the best way to get whatever is between the “@@”, while discarding the rest of the line?

(I could have “Googled” a little harder but figured I’d use the list.)

Thanks.

David

This message has been scanned by the Internet Service Departments Virus/Spam filter.

       
___________________
Nolug mailing list
nolug@nolug.org
Received on 11/20/06

This archive was generated by hypermail 2.2.0 : 12/19/08 EST