[lug] Fixing filename characters...

kenw at ihs.com kenw at ihs.com
Wed Jan 19 13:42:23 MST 2000


Ummm, with that many files you may need to use some variation of xargs
or find or ls in order to not overflow the command line buffer.

as in:

ls | while read file;do

substituting for the "for ..." line.

Sorry, typical case of hitting enter and then immediately after, your
forehead on the wall.

* kenw at ihs.com (kenw at ihs.com) [000119 13:37]:
> #!/bin/bash
> for file in *;do
> newfile=$(echo $file|tr " " "_")
> test "$file" != "$newfile" && mv "$file" $newfile
> done
> 
> 
> * B. Allyn (ballyn at catacom.com) [000119 13:20]:
> > Okee, so I just moved a bunch of images from a CD-ROM to my RH6.1 webserver,
> > and they've got lovely win32 spaces in them.
> > 
> > Rather than fix this on that side, how can I change the space to, say, an
> > underscore for the 1500 files in that directory?
> > 
> > TIA...
> > 
> > B. Allyn
> > 
> > 
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> -- 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

-- 




More information about the LUG mailing list