script i made to remove space (and other chars i dont like) from all files
in the current dir:
ls -1A > /tmp/desp.tmp
while read line
do
new=`echo -n "$line" | tr [:space:] _ | tr -d [=\(=][=\)=][=]=][=[=][=!=][=\'=][=,=][=?=] | tr [:upper:] [:lower:]`
if [ "$new" = "$line" ] ; then
continue
fi
mv -i -- "$line" "$new"
done < /tmp/desp.tmp
rm /tmp/desp.tmp
At 09:26 AM 02/13/2004, rich+ml@xxxxxxxxxxx wrote:Works for me, however I did forget to quote $x in original example.
That would do it. for x in *; do mv "$x" ${x// /}; done removes the spaces, but only works in bash 2. :(
- : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
- : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html