On Monday 06 January 2003 4:48 pm, Jean-Marc Lasgouttes wrote: > >>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > > Lars> gcc --version gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) > > Lars> All pragmas removed: size src/lyx text data bss dec hex filename > Lars> 2792162 80600 48796 2921558 2c9456 src/lyx > > What is the easiest way to remove those? > > JMarc
This seems to do the trick for all files in a particular directory and allows you to check before making the change. #! /bin/sh TEMP=tmp.$$ for FILE do test -d ${FILE} && continue test ! -f ${FILE} && continue sed '/#ifdef __GNUG__/,/#endif/d' ${FILE} > ${TEMP} DIFFERENCE=`diff -u ${FILE} ${TEMP}` || { echo "${DIFFERENCE}" | grep 'pragma' > /dev/null && { echo "${DIFFERENCE}" mv -i ${TEMP} ${FILE} } } done rm -f ${TEMP} -- Angus