Subject: bug#34279: guix-install.sh: uses /bin/bash shebang

From: Ricardo Wurmus <[email-masked]>
Date: Mon, 04 Feb 2019 22:56:01 +0100

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Claes Wallin (韋嘉誠) <[email-masked]> skribis:
>
>> This means ./guix-install.sh doesn't work on e.g. NixOS. :-)
>>
>> Please use /usr/bin/env bash.
>
> /usr/bin/env wouldn’t work on Guix System by default.  :-)

“guix-install.sh” arguably would not primarily be executed on a Guix
system.

> +# We require Bash but for portability we'd rather not use /bin/bash or
> +# /usr/bin/env in the shebang, hence this hack.
> +if [ "x$BASH_VERSION" = "x" ]
> +then
> +    exec bash "$0" "$@"
> +fi
> +

Neat!

--
Ricardo