From nobody Sat Sep 02 07:52:09 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rd6Yr19rbz4sGpm for ; Sat, 2 Sep 2023 07:52:16 +0000 (UTC) (envelope-from andreas.kahari@abc.se) Received: from hekla.abc.se (hekla.abc.se [158.174.61.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rd6Yq1SH9z3RMP for ; Sat, 2 Sep 2023 07:52:14 +0000 (UTC) (envelope-from andreas.kahari@abc.se) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=default; bh=dfkhdbyu05 wX/zSAXmTzNVLnvdbyUFvVVZk+pGjIM2k=; h=in-reply-to:references:subject: cc:to:from:date; d=abc.se; b=lHVaN83VerEqmXI4LxHARhPC3on6lRfQ1QmwjBwmk /UcgqeSllx4lH+yRAXqcqgIW8XxvAq8ANnjHdDGEIL4fC+Z1wCqf8nuJXtSIzRKyY9wV/G MUs5n0c9Bg6LcwGa2CpMa/uPVH6v7s6OZor38w8WPyAsizmJhoxoxZ0AqBRdMDNDIc+Dv0 xtD4SlMV1x7R2k8Yj3Abarf4Qq9zUjgTSa34B90nNa/PbhIKpgqUs/3Dse+bM4ohqvIyig WAhvkvtsyOZ2JTjMwGQE2emKxc2XzICxxvVmUVk8t1bLha7yEBnTmtHplZuORhiPXfR44J DxCCWlBcBzMIM0dK9JwNw== Received: from harpo.local (94-255-242-14.cust.bredband2.com [94.255.242.14]) by hekla.abc.se (OpenSMTPD) with ESMTPSA id 6c16f4d6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 2 Sep 2023 09:52:11 +0200 (CEST) Date: Sat, 2 Sep 2023 09:52:09 +0200 From: Andreas Kusalananda =?utf-8?B?S8OkaMOkcmk=?= To: Ralf Mardorf Cc: questions@freebsd.org Subject: Re: cut off last lines of a document Message-ID: Mail-Followup-To: Ralf Mardorf , questions@freebsd.org References: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> <4062326d85f9e9988b08ab49df4a59e3148fea76.camel@riseup.net> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4062326d85f9e9988b08ab49df4a59e3148fea76.camel@riseup.net> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8473, ipnet:158.174.0.0/16, country:SE] X-Rspamd-Queue-Id: 4Rd6Yq1SH9z3RMP On Sat, Sep 02, 2023 at 07:09:03AM +0200, Ralf Mardorf wrote: > Hi, > > to write a super portable script the best way would be to check what > operating system is used and to check the version of the used shell. > > case in FreeBSD) command=foo;; *) command=bar;; esac > > When using busybox there are a few extra pitfalls. > > Regards, > Ralf Just a thought: If you need to distribute a script that is supposed to run on different systems, and that contitutes its own "software package" (is an executable, has a manual and possibly some related documentation and examlpes etc.) then you also have the option of using things like GNU auto-tool (autoconf+automake) to generate a portable "configure" script that can be used for setting up the system-dependent parts of the script (or you could roll your own installation script). That way, portability options (and dependencies) are handled once and for all when installing the thing. A script meant for wider consumption than by yourself is like any other software. -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .