So for your example you would do rename.pl s/^new/U/ *.html *.shtml#!/usr/bin/perl -w # rename - Larry's filename fixer $op = shift or die "Usage: rename expr [files]\n"; chomp(@ARGV = <STDIN>) unless @ARGV; for (@ARGV) { $was = $_; eval $op; die $@ if $@; rename($was,$_) unless $was eq $_; }
--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
In reply to Re: batch rename with a 1 liner
by greenFox
in thread batch rename with a 1 liner
by Theo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |