[ale] Renaming many files (prefix-trim)
Wandered Inn
esoteric at denali.atlnet.com
Wed Jun 28 17:33:35 EDT 2000
Kenneth W Cochran wrote:
>
> Hi guys,
>
> I have another shell-question...
>
> I would like to rename some files, effectively "trimming" the
> 1st x number of characters from the filenames.
>
> I'd kinda like to do this with Bourne Shell, but Perl may be better.
> I'm checking books (still learning this) but I'm open to suggestions. :)
This works in ksh:
for fn in $(< listoffiles); do
mv $fn ${fn#???*}
done
Will remove the first ??? characters of each file. Vary ??? to suite
your needs.
>
> -kc
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
--
Until later: Geoffrey esoteric at denali.atlnet.com
Microsoft != Innovation
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list