Re: cut off last lines of a document
- In reply to: Ralf Mardorf : "Re: cut off last lines of a document"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 02 Sep 2023 07:52:09 UTC
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 .