The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
find and replace pattren in file
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
find and replace pattren in file
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
08-09-2007
robotronic
Can I play with madness?
Join Date: Apr 2002
Location: Italy
Posts: 370
Agreeing with your request, the {alphanumeric string with underscore} corresponds to "[0-9a-zA-Z_][0-9a-zA-Z_]*". So:
Code:
sed
"s/ [0-9a-zA-Z_][0-9a-zA-Z_]*:/x/g" file1.txt
But I think this is better:
Code:
sed
"s/ .*:/x/g" file1.txt
Bye
robotronic
View Public Profile
Find all posts by robotronic