On Tue, 8 Nov 2005 23:37:52 -0500, Walter Dnes wrote:
> That is not what sed is designed to do. "sed" is "Streaming EDitor".
> You specify an input file, and the changed file goes to STDOUT. If you
> want to change the original file, you need to use "ed".
Or use sed's -i or --in-place argumen
On Mon, Nov 07, 2005 at 03:38:00AM -0200, Rafael Barreto wrote
> Is this right? Well, what I really want is replace just CLOCK="fool1"
> by CLOCK="fool2" keeping the comments in line.
That is not what sed is designed to do. "sed" is "Streaming EDitor".
You specify an input file, and the changed
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
> CLOC
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Willie Wong wrote:
>On Sun, Nov 06, 2005 at 09:03:01PM -0800, gentuxx wrote:
>
>>sed -n '/^CLOCK=/s/^\(CLOCK=".*"\).*$/\1/p /etc/conf.d/clock
>>
>
>Ah, yes, I misunderstood the OP. I thought he didn't want the lines
>with trailing comments at all.
>
On Mon, Nov 07, 2005 at 03:42:05AM -0200, Rafael Barreto wrote:
> Other thing... Why was necessary to ^CLOCK= before
> s/^\(CLOCK=".*"\).*$/\1/p? And which the necessity of the ( ) between the
> regular expression?
as I just posted in another post, the /^CLOCK/ should not be strictly
necessary.
On Sun, Nov 06, 2005 at 09:03:01PM -0800, gentuxx wrote:
> sed -n '/^CLOCK=/s/^\(CLOCK=".*"\).*$/\1/p /etc/conf.d/clock
>
Ah, yes, I misunderstood the OP. I thought he didn't want the lines
with trailing comments at all.
But is it necessary to give the address for an s// replacement? As I
under
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Rafael Barreto wrote:
> Other thing... Why was necessary to ^CLOCK= before
s/^\(CLOCK=".*"\).*$/\1/p? And which the necessity of the ( ) between
the regular expression?
>
> Thanks again
>
Sorry for things being out of order, but you top-posted. The
Other thing... Why was necessary to ^CLOCK= before
s/^\(CLOCK=".*"\).*$/\1/p? And which the necessity of the ( ) between
the regular _expression_?
Thanks again
2005/11/7, Rafael Barreto <[EMAIL PROTECTED]>:
For that I understood, this command will return the line of CLOCK= in
/etc/conf.f/clock wit
For that I understood, this command will return the line of CLOCK= in
/etc/conf.f/clock without any comments. Is this right? Well, what I
really want is replace just CLOCK="fool1" by CLOCK="fool2" keeping the
comments in line.
By the way, \1 do really what? If i put \0 the result is the entire lin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Willie Wong wrote:
>On Mon, Nov 07, 2005 at 01:44:42AM -0200, 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 '/^CL
:) Thanks very much.
Now that I read your answear I searched in a book the significant of *,+ and others and I suppose I understood.
Thanks2005/11/7, Willie Wong <[EMAIL PROTECTED]>:
On Mon, Nov 07, 2005 at 01:44:42AM -0200, Rafael Barreto wrote:> Hi,>> I'm learning about the use of the sed comma
On Mon, Nov 07, 2005 at 01:44:42AM -0200, 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 pri
12 matches
Mail list logo