Re: Extract Text with "sed"
- From: Giorgos Keramidas <keramida@xxxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 14:32:30 +0200
On Tue, 29 Jan 2008 00:08:15 -0800 (PST), Meendar <meendar@xxxxxxxxx> wrote:
Hi,
I am having a text generated from version output of an executable as
$ myprogram -v
Version: Myprogram/1.2.1 - Centos
Built: Aug 8 2007 13:05:44
I need to extract 1.2.1 from the above output, however i used sed like
$ myprogram -v | sed -e '/s/Myprogram\ /(*) ^-
This doesn't work.
That's because the sed expression is either misformatted by the program
you used to post this message or just incomplete, or both.
$ ( echo 'Version: Myprogram/1.2.1 - Centos' ; \
echo foo ) | \
sed -n -e '1s/.*\/\(.*\) - .*/\1/p'
1.2.1
.
- Follow-Ups:
- Re: Extract Text with "sed"
- From: Meendar
- Re: Extract Text with "sed"
- References:
- Extract Text with "sed"
- From: Meendar
- Extract Text with "sed"
- Prev by Date: Re: Common code among main executable and shared objects
- Next by Date: Re: Extract Text with "sed"
- Previous by thread: Extract Text with "sed"
- Next by thread: Re: Extract Text with "sed"
- Index(es):
Relevant Pages
|
|