Batch File Rename with awk and sed


/ Published in: Bash
Save to your folder(s)

Leave off the final pipe to /bin/sh to do a 'dry run'


Copy this code and paste it in your HTML
  1. ls foo*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh

URL: http://www.macosxhints.com/article.php?story=20010509130450691

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.