[ Date Index ]
[ Thread Index ]
[ <= Previous by date /
thread ]
[ Next by date /
thread => ]
[LUG]Re: writing shell scripts
- To: list@xxxxxxxxxxxxx
- Subject: [LUG]Re: writing shell scripts
- From: "Dom (shymega) Rodriguez" <shymega@xxxxxxxxxxxxxx>
- Date: Sat, 25 Oct 2025 14:49:40 +0100
- Content-disposition: inline
- Delivered-to: dclug@xxxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dcglug.org.uk; s=1760519162; h=Content-Transfer-Encoding:Content-Type: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Help:List-Id: Subject:Reply-To:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date: Sender:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Archive; bh=4dnSNQMTyrprJN7FagMEZhYWd+a0vd9yzWLluSPCECU=; b=UquWQmouDmW6BSnMmPdx8uaTXS GNSW5spqw8QUrksgwE6xuQICnooQsuwRzablmM9VmiKZ1VwyyRqTcey9wgIw/wAwmkv0g7GHEZxTG hVrRuS4gBpIJVlpunlKpS00NlEHEkSOoEb6Yv4JTpnRtUSJveBZv4O+5ecSXlBhFSH1s=;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shymega.org.uk; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1761415241; x=1761501641; bh=g0FxpHy2NM uUE6TseOpdvsiX1bikSOLdPI1srFEfek4=; b=jrsYVSbogGW9c+EaNsVEFn8zpO GADUBHRPqr0YaPtVi9RCMv9DtjEAsN8vpDRIoEX5C+pS5mX2GHmWwo6QeSMQl0ZM yZeCOTB9peqxcCq70nhB4PZ3j9vZKm4V0hbFMnm5pFHREeERLHUW/RcqL1DkOjZb 03/vos6yMtsGBoM9A3KGKDZfzmKr5+U0btjiec4hWvL055at4qgOWx8mtkdclR5j WVjvlYpcZ4JsF9NqfN2aWLjek9YiMwp7u8IjtbR/3w3P6egisSgFspDI3lNzefXB Lk7Kbr/uq6nB+2wtlr1I4jv3ZGFuyzlu6Q6/CQXzOBGgbHra2Sz7A7fHLGaQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1761415241; x=1761501641; bh=g0FxpHy2NMuUE6TseOpdvsiX1bikSOLdPI1 srFEfek4=; b=cezctJV0SVs2cPJYkJWJKh4V0SFkcbiWSEtEc2xBcl9SH9vonmN 5QQqNMxYkjqpnD4q122XRPBshFT77D8VG3idzEAHl9Vh0dPWNGKASmwGYBJ2fg8H 0JvzVkVOkdS1oIy4E/9FQWtsX+dl+zBS1z1r7KfvgXxgdCPTnI/9ciwSahGOnAnj zgSX2LqLtoGprQVzoOrXAhSLkFkTf6S4NZBrkwGoAvTz/ehrg0pR9OEwvIx76Q3i 5b7lCqyW0Q8OpSrJtb2hgs0I7XDVGPINfwy0nBHr9ddZrbOwsdcQVao4c8hSpoW/ QBgnj4OyO5t5T8zy/hPp/lGvKYRT8TXeWxg==
- Feedback-id: idc46480c:Fastmail
On 25.10.2025 00:45, Dan Dart wrote:
Hello folks
Whilst I agree with the genAI sentiment (don't train it on copyrighted /
permissionless data), I'd just like to point out that when you're writing
*portable* shell scripts for other people, don't do this:
#!/bin/bash
#!/usr/bin/python
as they're not guaranteed to live there. That's what /usr/bin/env is for -
to provide the path to wherever it really does live, and it is much more
likely to exist where you might expect. So:
#!/usr/bin/env bash
#!/usr/bin/env python
This is also good for NixOS, which I believe you use, right Dan? The
amount of times I have to patch shebangs at work on in Nixpkgs to work
with `/usr/bin/env` is relentless.
Thanks for pointing this out!
Best wishes,
--
Dom Rodriguez
--
The Mailing List for the Devon & Cornwall LUG
FAQ: https://www.dcglug.org.uk/faq/