for i in `ls *_1.png`; do echo $i; cp $i `echo $i|ruby -pe '$_.sub!(/_1/, "_0")'`; done
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Copy files matching a regular expression to a new name (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Copy and rename files with w... in ruby rename glob copy Dir
» Ruby: Submit Apple Shake Scr... in ruby apple script render shake
» Scrape YouTube thumbnails in ruby www file video mechanize scraping youtube save scrape
» Scrape MySpace friend thumbn... in ruby www file mechanize scraping save scrape myspace
» Scrape torrents on btjunkie in ruby www file mechanize scraping save scrape btjunkie torrents bittorrent
» Typo under lighttpd in lighttpd ruby rails typo ruby-fcgi
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails