in reply to help on stripping out extra extensions
look at 'rename', there are two versions I'm aware of one which uses perl regexes and one which doesn't :). For the one with perl regexes something like 's/\.html$//' as the first arg and the files as the second+ arg should work. for the other version something like 'rename '.html' '' *.html' should fix it up, just be aware that that version replaces . *first* occurence.. look at the man page on you local machine to determine your version and find more options
and a pure perl solution
perl -e 'foreach (@ARGV) {next unless -f && /\.html\.html$/;($new = $_) =~ s/\.html$//;die $new if -f $new;rename $_, $new;}' *.htmlI'm sure that's longer than it needs to be... :( hehe. That should do it, *note that it is untested.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help on stripping out extra extensions
by Aristotle (Chancellor) on Jun 21, 2003 at 12:23 UTC |