#!/bin/sh
grep '\<Command.*Apps' $(find $HOME/GNUstep -type f -a -not -name '*.save') -h |\
	sed -e 's/^.*"\(.*\)".*$/\1/g' |\
	sort -u |\
while read original; do
	new=$(echo "$original" |sed -e's/Apps/Applications/g')
	if test -e "$new" -a ! -e "$original"; then
		grep "\<Command.*$original" $(find $HOME/GNUstep -type f -a -not -name '*.save') -H |\
			sed -e 's/^\(.*\):.*$/\1/' |\
			sort -u |\
		while read f; do
			cp $f $f.save && \
				sed -e "s@$original@$new@g" <$f.save >$f
		done
	fi
done

