Re: [PATCH] t4014: shell portability fix
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 1, 2016, 06:49 UTC
- Message-ID
- <xmqqshwx1k0p.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160601054048.GB20797@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> OK, last email tonight, I promise.
>
> Here's the subshell version. I'm a little embarrassed not to have
> thought of it sooner (though the other one was a fun exercise).
>
> test_env () {
> (
> while test $# -gt 0
> do
> case "$1" in
> *=*)
> eval "${1%%=*}=\${1#*=}"Is this an elaborate way to say 'eval "$1"', or is there anything more subtle going on?
Show 6 quoted lines
> eval "export ${1%%=*}"
> shift
> ;;
> *)
> "$@"
> exit... or 'exec "$@"'
Show 5 quoted lines
> ;; > esac > done > ) > }
You can dedent the whole thing and remove the outermost {} pair.Other than that, looks good to me.
> > -Peff