Reputation: 3183
I would like one sed
command to accomplish the following:
$ sed s'/:/ /g' <and> sed s'/=/ /g'
That is, I would like to write
sed s'/<something>/ /g'
and have both =
and :
replaced by space.
Upvotes: 22
Views: 39331
Reputation: 2343
Sanjay's answer solves it. Another option that works with only one sed command is to separate each s
substitution with a semicolon
sed 's/:/ /g ; s/=/ /g' file
or in separate lines in a script
sed 's/:/ /g
s/=/ /g' file
Those may be handy in other situations.
Upvotes: 6
Reputation: 6218
One option is also to use sed -e
, like this. Although you don't need it in this case, it's however a good option to know about.
sed -e 's/:/ /' -e 's/..../ /' file
Upvotes: 10