From mboxrd@z Thu Jan 1 00:00:00 1970 From: mlell@posteo.de Subject: Re: guix environment shebang interpreter Date: Thu, 06 Feb 2020 11:37:53 +0100 Message-ID: <9eff6bf44ddeebf488e6482a53cc0466@posteo.de> References: <877e1lwubl.fsf@euandre.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39362) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izeXo-0002ZU-6Q for Help-Guix@gnu.org; Thu, 06 Feb 2020 05:38:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izeXl-00030l-70 for Help-Guix@gnu.org; Thu, 06 Feb 2020 05:38:00 -0500 Received: from mout02.posteo.de ([185.67.36.66]:34579) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izeXk-0002pI-Ck for Help-Guix@gnu.org; Thu, 06 Feb 2020 05:37:57 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B57A5240106 for ; Thu, 6 Feb 2020 11:37:54 +0100 (CET) In-Reply-To: <877e1lwubl.fsf@euandre.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: EuAndreh Cc: Help-Guix , help-guix Hi! > Is there a Guix equivalent of the nix-shell shebang? > You could imagine something like: #! /usr/bin/env guix environment --ad-hoc PKG1 PKG2 ... -- INTERPRETER But alas, on linux you cannot put more than one argument in the shebang line. See this discussion: https://unix.stackexchange.com/questions/399690/multiple-arguments-in-shebang But, one answer there has a possible solution for you: https://unix.stackexchange.com/a/399698 --8<------------------------------------------------------- #!/bin/sh - if [ "$1" != "--really" ]; then exec bash --posix -- "$0" --really "$@"; fi shift # Processing continues ----------------------------------------------->8----------- It lets the script `exec` itself with the right arguments! So maybe put exec guix environment --ad-hoc PKG1 PKG2 ... -- INTERPRETER "$0" "$@" there? Cheers, Moritz