Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sed quickie.

Status
Not open for further replies.

Dorga

MIS
Jul 30, 2003
101
NZ

I am using this in part of a commandline,

sed 's/LTO3-count ... (Should be 100/LTO3-count ... (Should be 120/g'

the first ... is a random number, in this case 3digit, the second ... I had hoped would replace the original number and not changed it to ..., I was wrong.

How can I ignore the first ..., place it back in the location of the second ..., and still change what I am trying to?
 
something like this ?
sed 's/LTO3-count \([0-9]*\) (Should be 100/LTO3-count \1 (Should be 120/g'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks for reminding me how flat forgetful I can actually be.

DUH! =-)

Thank thats perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top