Re: [RFC/PATCH] tests: add initial bash completion tests

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

 



On Sat, Apr 7, 2012 at 2:33 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
>> Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:
>>
>>> What about this instead?
>>>
>>> #!/bin/sh
>>>
>>> if type bash >/dev/null 2>&1
>>> then
>>>      # execute inside bash
>>>      [ -z "$BASH" ] && exec bash $0
>>> else
>>>      echo '1..0 #SKIP skipping bash completion tests; bash not available'
>>>      exit 0
>>> fi
>> ...
>> Other than that, it is very much simple and straight-forward.  I like it.
>
> It probably is even simpler to do it like this.
>
> if test -z "$BASH" && ! exec bash "$0" "$@"

That would exit immediately with an error:

t9902-completion.sh: 6: exec: bash: not found
make: *** [t9902-completion.sh] Error 127

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]