>
> Totally untested...
And it showed :p
Try the following
#!/bin/bash
NEW_ROOT="/tmp/new"
for dir in *
do pushd $dir
for files in *
do newdir=`echo $files | cut -d - -f 1`
mkdir -p $NEW_ROOT/$newdir
mv -i $files $NEW_ROOT/$newdir/
done
popd
done
--
Linux Counter user #273956
Don't email joeblogs at scouts.org.au