Skip to content

Removing colons from filenames

August 12, 2005

I was just speaking with a colleague about when to use shell scripting versus Perl, and it reminded me of my last attempt to do something without the Perl crutch- an equal mix of crudeness and elegance:

find . -name \*:\* | sed "s/\(.*\):\(.*\)/mv '&' '\1\2'/" | sh
Advertisements

From → Misc

2 Comments
  1. Anonymous permalink

    Those are colons in that line; not a semicolon in sight

  2. rama permalink

    whoops- thanks. title has been corrected.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: