From: Alexander Skwar <listen@alexander.skwar.name>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] About sed
Date: Mon, 07 Nov 2005 08:49:21 +0100 [thread overview]
Message-ID: <436F0701.8070606@mid.message-center.info> (raw)
In-Reply-To: <5de801760511061944y45b2911dn@mail.gmail.com>
Rafael Barreto wrote:
> Hi,
>
> I'm learning about the use of the sed command and I have some questions.
> I'm trying to read in /etc/conf.d/clock the CLOCK variable with:
>
> sed '/^CLOCK="*"$/p' /etc/conf.d/clock
>
> This command, in principe, must print in screen the line that contains
> CLOCK= in the begin, contains anything between double quotes and ends.
No, that's not what it does. It matches "CLOCK" at "beginning
of line" (^) followed by = followed by any number of " followed
by another ", which is the last character of the line.
You forgot the . before the *.
> Other thing... if i put:
>
> sed '/^CLOCK=*/p' /etc/conf.d/clock
>
> the return will be anything that contains CLOCK. Why?
No, it will return all lines, that start with CLOCK, followed
by any numbers of =. You again missed the . before the *.
> Thanks a lot and sorry by my english...
No problem at all, but please do not send HTML junk to
the list. That's not so much excusable (well, that's of
course an exaggeration by me...).
Alexander Skwar
--
Men of quality are not afraid of women for equality.
--
gentoo-user@gentoo.org mailing list
prev parent reply other threads:[~2005-11-07 8:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-07 3:44 [gentoo-user] About sed Rafael Barreto
2005-11-07 4:07 ` Willie Wong
2005-11-07 4:19 ` Rafael Barreto
2005-11-07 5:03 ` gentuxx
2005-11-07 5:38 ` Rafael Barreto
2005-11-07 5:42 ` Rafael Barreto
2005-11-07 6:37 ` gentuxx
2005-11-07 7:25 ` [gentoo-user] [OT] " Willie Wong
2005-11-07 7:19 ` [gentoo-user] " Willie Wong
2005-11-09 4:37 ` Walter Dnes
2005-11-09 8:56 ` Neil Bothwick
2005-11-07 6:55 ` Willie Wong
2005-11-07 7:35 ` gentuxx
2005-11-07 7:49 ` Alexander Skwar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=436F0701.8070606@mid.message-center.info \
--to=listen@alexander.skwar.name \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox