You are not logged in.
Pages: 1
Hi there
As far of I know, most of recent systems use the "rename" script from larry Wall ( Perl dad ).
Why don't using it as default "rename" like most of modern systems ? I use Debian/redhat systems most of the time @work, and I was wasting some time to understand that Arch implement "rename" in an other way. I'm pretty sure I'm not the first one, and not the last one too.
( For thoses wanting the original perl script from Perl dad, download http://search.cpan.org/CPAN/authors/id/ … 1.6.tar.gz and add it in your $PATH before /usr/bin I use a custom ~/bin dir for that kind of stuff or see aur/perl-rename )
See ya.
Last edited by sputnick (2009-11-20 00:49:30)
Offline
The "rename" binary that I have on my system comes for util-linug-ng. What is better about the perl version?
Offline
"rename" from util-linug-ng is a simplified less powerfull tool. Moreover, the well known syntax 's/pattern/other-pattern/' doesn't fit with this package. The perl version can do complex substitutions with ( back references ), like this example from another post :
rename -v 's/\w+\.(\dx\d+)\.(.+)\.german.*\.(\w{3,})/$1 - $2.$3/' *
Offline
http://aur.archlinux.org/packages.php?ID=15512
The package is orphaned so you can adopt and maintain it if you like.
@Allan
I haven't used it, but a rename binary that supports Perl regular expressions would be orders of magnitude more powerful than the default one.
*heads off to play with Perl scripts*
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
@Xyne : prename is an extract of debian package, it's not needed. The good one is perl-rename http://aur.archlinux.org/packages/perl- … e/PKGBUILD and it's quite maintened.
I like Arch in part because it use powerfull modern tools and keep users to decide what is good or not ( like non-free stuff ).
Using something different of Perl rename doesn't makes sense for me, and I think some others users and sysadmins too.
Edit : Debian default is Larry Wall original script with small changes, his name under debian is prename.
That's what my debian chroot said :
# echo 'readlink -f $(type -p rename)' | chroot /home/chroot bash -s
/usr/bin/prename
The perl-rename ( PKGBUILD based on CPAN ) is an improved one, ( written by Peder Stray, original script from Larry Wall ) the help output confirm that ( code too ):
# /usr/bin/perlbin/site/rename --help
Usage: rename [OPTION]... PERLEXPR FILE...
Rename FILE(s) using PERLEXPR on each filename.
-b, --backup make backup before removal
-f, --force remove existing destinations, never prompt
-i, --interactive prompt before overwrite
-S, --suffix=SUFFIX override the usual backup suffix
-v, --verbose explain what is being done
-V, --version-control=WORD override the usual version control
-n, --just-print, --dry-run don't rename, implies --verbose
-l, --link-only link file instead of reame
--help display this help and exit
--version output version information and exit
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The
version control may be set with VERSION_CONTROL, values are:
t, numbered make numbered backups
nil, existing numbered if numbered backups exist, simple otherwise
never, simple always make simple backups
Report bugs to pederst@cpan.org
debian (p)rename :
# chroot /home/chroot rename --help
Unknown option: help
Usage: rename [-v] [-n] [-f] perlexpr [filenames]
Last edited by sputnick (2009-11-20 01:39:03)
Offline
The perl rename has proven to be enormously helpful in renaming mixed-case filenames and directories (happens when copying stuff from windows from a FAT-formatted disk) to lowercase. I was wondering for a while why the 'rename' tool in my Arch install didn't work as advertised on numerous forums. Thanks to this thread I know now.
musician & coder
http://elephly.net
http://github.com/rekado
Offline
Pages: 1