Re: [PATCH 7/8] oe-git-proxy.sh: Add a new comprehensive git proxy script

Otavio Salvador
2013-02-05T18:56:50Z

On Tue, Feb 5, 2013 at 3:44 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>
>
> On 02/05/2013 08:36 AM, Enrico Scholz wrote:
>> Darren Hart <dvhart@linux.intel.com> writes:
>>
>>>>> + $NC -X connect $*
>>>>
>>>> why '$*' but not '"$@*"'?
>>>>
>>> I'm not familiar with $@*
>>
>> sorry... I meant "$@"
>>
>>
>>> As for $* versus $@, the issue is how the arguments are presented. $*
>>> as a single word, $@ each argument is quoted separately. I believe I
>>> ran into issues with $@. I haven't had any trouble with $*.
>>
>> $* is causing trouble all the time because it does not retain whitespaces
>> or empty parameters. There are only very few cases, where $* makes sense.
>>
>>
>>> Is there a particular use case where you can see this failing as is?
>>
>> "$@" is just the right thing to do in this situation. E.g. when your
>> script is called as
>>
>> | oe-git-proxy.sh "${HOST}" "${PORT}"
>>
>> and HOST is undefined due to some reason, you will try to connect to
>> "${PORT}" with $*. The "$@" will cause nc to complain about the broken
>> HOST parameter.
>>
>>
>> Btw...
>>
>> | exec $NC $METHOD "$@"
>>
>> would be the school book implementation for the thing you want to do...
>>
>>
>>
>> Enrico
>
> That all makes sense. When I read up the difference again in the bash
> documentation I was surprised I had used $*, but thought I had done that
> dance already. I'll update with "$@" and do some tests.
>
> Thank you for the review and catching that.

Please give it a try in dash as well.

--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br