Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] Re: Script to fix filenames


\begin{Nick Croft}
> I keep getting batches of jpegs without the .jpeg extension (or any other
> permutation).
> 
> What area of scripting should I look to in order to add the extension. Is
> sed able to work on filenames in a directory as it doeson words in a file?

for f in *; do
  test -z "${f##*.*}" || mv $f $f.jpeg
done

or something..

-- 
 - Gus