Joakim, please quote only relevant parts of the message you reply to. Thanks. * Joakim Tjernlund wrote on Sat, Sep 13, 2008 at 11:40:46AM CEST: > > > > #! /bin/sh > > set -e > > LC_ALL=C > > export LC_ALL > > adds=adds.$$ > > inits=inits.$$ > > tmp=tmp.$$ > > for file in `find . -name Makefile.am`; do > > sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *+=.*/\1/p' "$file" | sort -u > $adds > > sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *=.*/\1/p' "$file" | sort -u > $inits > > needed=`join -v 1 $adds $inits` > > mv "$file" $tmp > > { echo "$needed" | sed 's/$/ =/'; cat $tmp; } > "$file" In this line, change the sed script to be '/^$/d;s/$/ =/', to fix ... > > done > > rm $tmp $adds $inits > Works fairly well, just one thing: > It turns already correct assignmenst like: > SUBDIRS = xxxx > SUBDIRS += yyyy > into > = > SUBDIRS = xxxx > SUBDIRS += yyyy ... this. _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf