LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Forward slashes in filenames. Convert from 2f to Colon (https://www.linuxquestions.org/questions/linux-general-1/forward-slashes-in-filenames-convert-from-2f-to-colon-162704/)

chrisk5527 03-26-2004 02:42 PM

Forward slashes in filenames. Convert from 2f to Colon
 
I'm pulling files from a CD on a Mac over to Linux through Netatalk. When I do, the / in the filename is converted to a 2f (2f is hex for / ) . Is there anything that Samba or Netatalk can do to convert the 2f to a hyphen on the fly? I saw an option called "mangled map" for Samba, but I couldn't figure it out. Is there some kind of program that will look at a filename, see the 2f and convert it to a hypen? Any solution would be good.

chrisk5527 03-26-2004 03:19 PM

Search filenames for specific characters
 
How can I search a filename 2f and replace it with 2d? These hex values will replace a / with a - . Is there a program available to search filenames?

trickykid 03-26-2004 03:22 PM

//Moderator Note: I merged these threads to keep the discussion in one thread, since these are similiar enough. Regards.

Looking_Lost 03-26-2004 04:22 PM

You mean replace occurrences of the character sequences 2f in a filename for files that exist on your hard drive? I don't know samba or netaralk way but

If so, if

filename=the name of a file with lots of 2f in it

You could incorprate

mv $filename ${filename//2f/-} # replace the - with whatever you want

into a simple script, anyway that's one way if I've understood right.


All times are GMT -5. The time now is 01:16 AM.