On Monday, 27 December 2021 at 9:52:24 +0700, Rudi Blom wrote:
My official status seems a bit unclear (although
I'm getting paid :-) ) but
unofficially I keep an eye on a lot of a customers servers. Ad-hoc shell
scripts still have similar structure as I know how to 'cut and paste'.
These scripts are run remotely via a 'homegrown' client-server setup. Many
should run on different UNIX environments and therefore have near the
beginning an OS check. Depending on that I can set PATH and anything else
important.
#
# check what type of OS this system runs on
#
OST=`uname -m`
That's the architecture. Wouldn't just `uname` be better? I have:
case `uname` in
Linux)
PATH=.:~:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/Photos/Tools
export SHELL=/bin/bash
;;
NetBSD)
PATH=.:~:/usr/pkg/bin::/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/usr/local/gnu-autotools/bin:~:/Photos/Tools
export SHELL=/usr/pkg/bin/bash
;;
FreeBSD)
PATH=.:~:/home/local/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Photos/Tools:~
export SHELL=/usr/local/bin/bash
;;
...
And yes, lm, if you're looking, there's really a /usr/local/bitkeeper
in there. It's been years, but I don't tidy these things up very
often. I only just removed mosaic from my fvwm2 config menus.
Greg
--
Sent from my desktop computer.
Finger grog(a)lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read
http://lemis.com/broken-MUA.php