Enflat
By: a guest | Mar 19th, 2010 | Syntax:
Bash | Size: 0.46 KB | Hits: 80 | Expires: Never
#!/bin/bash
if test -z $1;then
echo "Nuffin to enflat?"
exit
fi
function enflat {
for x in "${@}";do
if file "$x"|grep -q directory;then
echo "enflattening $x"
enflat "$x"
rmdir "$x"
else
echo "enflattening $x"
mv "$x" ..
fi
done
}
cd $1 && enflat *