Deal with invokers who pass us environment variable settings as part

of the command they want us to run.

Fixes part 3A of PR#14046
This commit is contained in:
sommerfeld 2001-09-24 00:20:11 +00:00
parent 9b9300274d
commit b27c418d40

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.sh,v 1.10 2001/03/06 02:20:18 cgd Exp $ # $NetBSD: genassym.sh,v 1.11 2001/09/24 00:20:11 sommerfeld Exp $
# #
# Copyright (c) 1997 Matthias Pfaller. # Copyright (c) 1997 Matthias Pfaller.
@ -35,13 +35,28 @@
awk=${AWK:-awk} awk=${AWK:-awk}
if [ $1 = '-c' ] ; then if [ "$1" = '-c' ] ; then
shift shift
ccode=1 ccode=1
else else
ccode=0 ccode=0
fi fi
# Deal with any leading environment settings..
while [ "$1" ]
do
case "$1" in
*=*)
eval export "$1"
shift
;;
*)
break
;;
esac
done
trap "rm -f /tmp/$$.c /tmp/genassym.$$" 0 1 2 3 15 trap "rm -f /tmp/$$.c /tmp/genassym.$$" 0 1 2 3 15
$awk ' $awk '