how to mass-rename files with * and / that are not in windows

oROEchimaru

Supreme [H]ardness
Joined
Jun 1, 2004
Messages
4,662
We need to backup some data without losing the file formats. We have macs and a novel server that has file names with * and / in the names, such as in a date. We need to remove or change these characters quickly since there are over 10,000 files.

The pc and win2k3 server truncates the names... or does not copy them at all.

1. if you try naming a windows file with a * or / it will not let you.
2. if you copy a novell/mac file with * / in it, to winxp... it is truncated (from a winxp computer over the network from a novel network drive)
-this is bad since it does not label it properly somtimes instead of 11/23/55 it might be 11~~~55backup or something, so it looks goofy

3. if you are on a mac, and try copying a * file name or / from novell drive to the pc storage (scsi on win2k3) it will not let you copy at all


I need a way to rename a large group of files on a mac or novell... if it was possible i'd do it on pc but it does not even show the funky characters to rename! it treats * as wildcard only

help asap please
 
I ran into this same problem with a customer. They had a Mac with thousands of picture files with "/" in the file name to indicate a measurement (1/2", 4/5"....). The only way to rename the files is to do it on the Mac before moving the files to another system/OS. You can probably write a script to rename files with the underlying BSD of the Mac.
 
Code:
#!/bin/bash

ls | while read -r FILE
do
    mv -v "$FILE" `echo $FILE | tr '/' '-' `
done

Try adujusting that to your needs.
 
Back
Top