[buug] more specific

Aleksandr Melentiev alex at myzona.net
Wed Apr 30 14:20:27 PDT 2003


Specific answer to your specific question:

kronos# cat testfile
aaaaaaaaaaaaaaaUserID=oldid&bbbbbbbbbbbbbbbbbbbb

kronos# cat testfile | sed -e "s:UserID=oldid:UserID=newid:g" > newfile

kronos# cat newfile
aaaaaaaaaaaaaaaUserID=newid&bbbbbbbbbbbbbbbbbbbb

----- Original Message ----- 
From: "johnd" <john at jjdev.com>
To: <buug at weak.org>
Sent: Wednesday, April 30, 2003 2:07 PM
Subject: [buug] more specific


> let me ask a more specific question
> 
> if I have a file with lines that have UserID=somestuff&
> 
> surrounded by other text
> 
> how can I substitue the UserID=somestuff for say UserID=foo
> 
> the file is like this
> 
> aaaaaaaaaaaaaaaUserID=oldid&bbbbbbbbbbbbbbbbbbbb
> 
> and I want to make it
> 
> aaaaaaaaaaaaaaaUserID=newid&bbbbbbbbbbbbbbbbbbbb
> 
> the substring is UserID=text  and ends at the &
> _______________________________________________
> Buug mailing list
> Buug at weak.org
> http://www.weak.org/mailman/listinfo/buug
> 



More information about the buug mailing list