From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ALZ1H+MAPWOr0AAAbAwnHQ (envelope-from ) for ; Wed, 05 Oct 2022 05:58:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WJSaHuMAPWMlWQEAG6o9tA (envelope-from ) for ; Wed, 05 Oct 2022 05:58:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 449F8B0A8 for ; Wed, 5 Oct 2022 05:58:27 +0200 (CEST) Received: from localhost ([::1]:38584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofvYA-0000xY-5M for larch@yhetil.org; Tue, 04 Oct 2022 23:58:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofvY0-0000xP-Ig for help-guix@gnu.org; Tue, 04 Oct 2022 23:58:16 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:60701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofvXx-0008JL-K0 for help-guix@gnu.org; Tue, 04 Oct 2022 23:58:15 -0400 Received: from localhost (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 2953w5Lo018078; Tue, 4 Oct 2022 23:58:09 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 2953w5Lo018078 To: Maxim Cournoyer , Olivier Dion via Cc: jordi Subject: Re: bash scripts in Guix question In-Reply-To: <871qrnj5wu.fsf@gmail.com> References: <871qrnk61s.fsf@laura> <871qrnj5wu.fsf@gmail.com> Date: Tue, 04 Oct 2022 23:58:05 -0400 Message-ID: <877d1eapma.fsf@laura> MIME-Version: 1.0 Content-Type: text/plain X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Wed, 5 Oct 2022 03:58:05 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: Olivier Dion From: Olivier Dion via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664942307; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5R233JUIPL/Dg9ynjNQCbTQOemP0FEePVmYzfgsW34w=; b=dtyTeY555SBuhXhDwE+GY7s1NoHxxPsEMT9BFWNZm+4T5wrHESJdI2iZMQjYMUElsQJzra eQDxx8x8gBLPfjZqi6lmTJGBISr9xKXPfGWME7k5l9uDSRvLYmfk50sjvpDwbueQMR3jQ9 1H02uC7ijqoNpYTp3fTdg5c/A1uFwx5mL5vCSC45/HmBOf8hHEa5oD7oy3dkt1c231uPfe TVK5w3yjwwJ+v42aPIsSUROV1CtGbu6kLIwlZZzmStYQCGwXiZTSC0hEueKrLSsMawXmsh iI5JBhM5bc0r3vyscVAd344JnbJtfb9ImMg8ta13Lxk/LLc2aKAjYLV1YKn15Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664942307; a=rsa-sha256; cv=none; b=EExv5t4zXTB15p7bK6JRSW98ZjAwM984KNZOn8ZTAXMRjncChr/u7nC8/d9gL3vBddKi7D gcc5JnzoS+XGFrdCImSZMpKEbbyf+EvxlmG2tc6NOom/Q/7g4rO7KnxS6fbpTiH/8+EbdW 5HEKUbNeEa83bbkhcgmcmF3F2UjOojhxo3mofIFyTPQUBdxGDR9Ft17vleE/hSBkhCAZPi deya0mzeJnQ9loqouhPeWhvgMXPPfOVoNt4cnyFGviVz02IZk/nUwzlFm2bYZdmhYgeuiq lIjQvQEAwOa49Y02PqVGHy1NaYP/1OvKZQ7XumDcpP6CP5Rsfqnm6rIGqkI+yw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.16 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 449F8B0A8 X-Spam-Score: -2.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: LKE9Mv/afVjb On Tue, 04 Oct 2022, Maxim Cournoyer wrote: > Hi, > > Olivier Dion via writes: > >> On Tue, 04 Oct 2022, jordi wrote: >>> Hi guixers, >>> >>> i'm wondering...for my scripts to work in Guix, instead of >>> '#! /bin/bash' , >>> >> >> Typically the `sh' program should be a symlinked to `bash' in your >> system profile. I think it is the case for many distro. If you want it >> to be bulletproof though for other distros maybe something like that: >> >> #!/bin/sh >> if [ "$(basename $SHELL)" != "bash" ]; then >> exec bash "$0" "$@" >> fi >> >> echo "hey!" > > I prefer the "#!/usr/bin/env bash" shebang; /usr/bin/env is available on > FHS distribution, and on Guix System, for convenience. You can use if > for any interpreted script, such as Guile, Python, Perl, etc. Only if coreutils is in the profile that would work yes. -- Olivier Dion oldiob.dev