Computing.Net > Forums > Unix > Sed help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sed help

Reply to Message Icon

Name: vibhor_agarwalin
Date: February 7, 2005 at 06:00:47 Pacific
OS: Solaris
CPU/Ram: sparc
Comment:

Hi,

In sed it sometimes uses
sed -e '.../.../.../\1'
whats the use of \1 or any other number there.

Vibhor Kumar Agarwal



Sponsored Link
Ads by Google

Response Number 1
Name: vgersh99
Date: February 7, 2005 at 06:11:47 Pacific
Reply:

man sed:

The characters \n, where n is a
digit, will be replaced by the text matched by
the corresponding backreference expression.
For each backslash (\) encountered in scanning
replacement from beginning to end, the follow-
ing character loses its special meaning (if
any).

vlad
#include<disclaimer.h>


0

Response Number 2
Name: vibhor_agarwalin
Date: February 8, 2005 at 05:34:53 Pacific
Reply:

Ooops,

I read it, but somehow it didn't click, or i was unable to corelate.
Sometimes just a tinkle helps.

Another required now.
This works only when i use:
s/\(.*\)xyz/\1XYZ/
i.e. \(.*\)
What does this specify.

Vibhor Kumar Agarwal


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Scritp how to Old UNIX



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Sed help

Sed Help [/] www.computing.net/answers/unix/sed-help-/6762.html

sed help with variable length file www.computing.net/answers/unix/sed-help-with-variable-length-file/5632.html

sed help www.computing.net/answers/unix/sed-help/6080.html