Date: Sat, 2 Sep 2023 09:52:09 +0200 From: Andreas Kusalananda =?utf-8?B?S8OkaMOkcmk=?= <andreas.kahari@abc.se> To: Ralf Mardorf <ralf-mardorf@riseup.net> Cc: questions@freebsd.org Subject: Re: cut off last lines of a document Message-ID: <ZPLpqQSroicd0Y/4@harpo.local> In-Reply-To: <4062326d85f9e9988b08ab49df4a59e3148fea76.camel@riseup.net> References: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> <de480aeb-3f8c-4be2-8162-6d9f033f201a@nebelschwaden.de> <bybyzt4obn2by3bn6gm7k72wy62kn2mlmaubnsk4o7wb62ulkj@hfdamyqm2qp4> <4062326d85f9e9988b08ab49df4a59e3148fea76.camel@riseup.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 .
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZPLpqQSroicd0Y/4>
