[PLUG] Converting Uppercase File Names to Lowercase
Michael Rasmussen
michael at jamhome.us
Sat Jun 22 20:02:12 UTC 2013
On Sat, Jun 22, 2013 at 11:42:15AM -0700, wes wrote:
> On Sat, Jun 22, 2013 at 9:45 AM, Rich Shepard <rshepard at appl-ecosys.com>wrote:
> > On Sat, 22 Jun 2013, Bill Barry wrote:
> >
> > > Remove the second echo
> > > echo mv -i "${FiLe}" "${file}"
> > > ->
> > > mv -i "${FiLe}" "${file}"
> >
> > Wil suggested the second echo to test before borking the files.
> >
> here is your problem... after testing, you're supposed to remove the echo
> and run it again to "do it live"
Simplier would be to just pipe the verified output into your shell, assuming bash:
michael at bivy:/srv/photo/365_2012/this_month/296_Jun_21/t$ ls
OM211853.JPG OM211854.JPG OM211863.JPG OM211864.JPG tsh
michael at bivy:/srv/photo/365_2012/this_month/296_Jun_21/t$ ./tsh # run to verify, "tsh" is Rich's original script
mv -i OM211853.JPG om211853.jpg
mv -i OM211854.JPG om211854.jpg
mv -i OM211863.JPG om211863.jpg
mv -i OM211864.JPG om211864.jpg
mv -i tsh tsh
michael at bivy:/srv/photo/365_2012/this_month/296_Jun_21/t$ ./tsh | bash # sent to shell for execution
mv: `tsh' and `tsh' are the same file
michael at bivy:/srv/photo/365_2012/this_month/296_Jun_21/t$ ls # verify results
om211853.jpg om211854.jpg om211863.jpg om211864.jpg tsh
michael at bivy:/srv/photo/365_2012/this_month/296_Jun_21/t$
Though I'd suggest changing
for FiLe in *; do
to
for FiLe in $@; do
and then you'd run the script with arguments about what you really want to change, for example:
./tsh *JPG
--
Michael Rasmussen, Portland Oregon
Be Appropriate && Follow Your Curiosity
Other Adventures: http://www.jamhome.us/ or http://gplus.to/MichaelRpdx
A special random fortune cookie fortune:
I'm predicting spirited competition for Lanterne Rouge. Don't take it for granted.
~ Mark Thomas
More information about the PLUG
mailing list