Penguin

Tabs vs Spaces

Eclipse has issues with my version 2.1.3, where it sometimes substitutes \t(abs) for (the equivalent of) four spaces. This makes CVS and other editors handle the tabs differently depending being fixed-width or not and so the spaces show up unequal. Here is a quick parser from DrewBroadley to fix the problem:

#!/bin/sh
FILE=$1
TMPFILE=${FILE}.tmp
cp ${FILE} ${TMPFILE}
perl -ple 's/\s{4}/\t/gi' ${TMPFILE} > ${FILE}
rm ${TMPFILE}