fucking the white bunny rabbit

this blog is a feature

sed regexp tips #1

leave a comment »

Thanks to Jigen, this is another method to add and remove semicolon with sed. The result is the same as here.

To add semicolon:

sed -e ‘s/[01]/&;/g’ foo

To remove semicolon:

sed -e ‘s/\([01]\);/\1/g’ foo

Advertisement

Written by whitenoise

October 30, 2007 at 8:07 pm

Posted in knowledge, Linux, scripting

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 260 other followers