Recursive search for filenames containing ..

Hi all,

Since my gopher server doesn't like filenames containing 2 or more consecutive dots in a filename, I'd like to do a search for them and replace them with... well, let's say underscores...

I've tried a oneliner or 2 from other posts, but they don't seem to work well with locating dots.

Who can help me out here? It is of course absolutely imperative that we keep the Gopher technology alive & kicking! :wink:

greetings,
Evert

If you're curious, visit gopher.meulie.net with your Gopher-enabled browser :slight_smile:

find /wherever -name "*..*" -print ?

You could then redirect the output of the find to a file "listfile" for example and then use the following to rename them, assuming that every dot (more than one consecutive) being replaced by an underscore ie. 3 dots = 3 underscores:

while read L; do mv $L $(echo $L|sed '/\.\{2,\}/ {s/\./_/g}'); done < listfile

Just have to be careful that you you don't start your find with a dot as starting directory.

Thanks for all the excellent answers! :slight_smile:

To be honest, I've actually opted for another solution (didn't know it was an option when I wrote my post): I've switched from pygopherd to Gophernicus.
Gophernicus doesn't seem to mind '...', so my problem is solved! :slight_smile: