[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mass Makefile commit

On Fri, Mar 15, 2002 at 10:06:39AM +0100, Gerfried Fuchs wrote:
>         Hi!
>  If you wondered about my mass Makefile commit in the german directory,
> I've found an easy way to check for outdated Makefiles and I'd like to
> share it with you all:
> #v+
> for i in `find german -name Makefile `; do
> 	if [ -n "$(diff `echo $i | sed 's/^german/english/'` $i)" ]; then
> 		cp `echo $i | sed 's/^german/english/' $i
> 	fi
> done
> #v-
You forgot a ` after german/english/'
And you can also make it a bit faster and simpler:

for i in `find german -name Makefile `; do
    j=`echo $i | sed 's/^german/english/'`;
    if [ -n "$(diff $j $i)" ]; then
	cp $j $i

Reply to: