#!/usr/local/bin/perl # picture mover...moves pix and their thumbnails $dir = pop @ARGV; unless(-d $dir){ print "the destination is not a directory!\n"; exit(0); } foreach $file (@ARGV){ ($fdir,$f) = $file =~ m|^(.*?)([^/]+)$|; $fdir = "./" unless($fdir); `mv $file $dir`; foreach $sub (".full",".thumb",".thumb-small"){ `mv $fdir$sub/$f $dir/$sub`; } print "moved $file\n"; }