From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2729 invoked from network); 27 Dec 2021 04:06:29 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 27 Dec 2021 04:06:29 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7AAC89CFC0; Mon, 27 Dec 2021 14:06:28 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id CC29F9CE84; Mon, 27 Dec 2021 14:06:22 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KMjcMjA2"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 9410C9CE84; Mon, 27 Dec 2021 14:06:21 +1000 (AEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by minnie.tuhs.org (Postfix) with ESMTPS id BD12A9CE58 for ; Mon, 27 Dec 2021 14:06:20 +1000 (AEST) Received: by mail-wr1-f49.google.com with SMTP id s1so30034330wra.6 for ; Sun, 26 Dec 2021 20:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B2Hl0VIw3qc4egF8/UkdQuKQOG2kZN4mkhAsAh8PREo=; b=KMjcMjA2NltxADwPao8d0GmosGRCzVYnKC05wm4HG0xpNu0/WQhamgdNVOBSNwhQ9T 0rXDU/AGPoRpUBCvlRJiRuOs4BD2pnvnMzeEyqk8w4Itp2hQPqFnhF85U0lZavQdWHjW hL+jEu1BhH2m4PxvNwnW6PvC0WVKT4P1/5K+q1nyJ8GJHSBJiW8wajzEQP8mJbPWwO2w uWInY7dqACOSBsYMUGxyq4Gxy49xGqzqCQ+3FyUwwo9S8VNQ+ffS8m5SZxNJ0eL3OoRY CB3PV7MBVPL+6XosPE4lsIMwJefmuRGXMHCO6uvwn/fG/6cHFhjvINbE54qZX/fHTR0L /oCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B2Hl0VIw3qc4egF8/UkdQuKQOG2kZN4mkhAsAh8PREo=; b=uedBDtRhppKDCdfXN++aQej+fyponUPz3IqAQT+cf37CKls22nfVvbOuSGCgwV3Bme OP+TJMv4EQQD9d0AWJ1tH+bIBjQHDnu0ti/srmEtKJanA32ZQn4/D7lAsimXuAvs/NMn EsP8PhkZQC53ezMJIH1LW1ObEPUHk04D6XuXk+zUuswz6acpqQ+e3248wOnfOquCygwD PsfO1WnC8vrZhLUoKTCop94bEGXLVKfvnnyxtXAuSzVAig1TY2iHo/4lgW+QlnxxQBLk MGi0PbLYqjHo8DvK8E5lQwcTivv/hVcdi0u++kD46V0KRuyUskz4jQeay8IUjTgguugs Omww== X-Gm-Message-State: AOAM533J8LfZ+/SvvU9LE47axqgjindygT5rPSCoWAU4AYSaRP/vTYeP VXy73s4uVaNjy6Nity+igxYdqvzRferYmUl9IQ== X-Google-Smtp-Source: ABdhPJyCRB7k5HPsmy/f2UGsVoLZnCU4i9xZOaAB1pVVP32+QY2GraSw+Jsqjn91t6LTEZMZ//cqD1HmQUDFglyl2dU= X-Received: by 2002:a05:6000:1886:: with SMTP id a6mr11617650wri.614.1640577979131; Sun, 26 Dec 2021 20:06:19 -0800 (PST) MIME-Version: 1.0 References: <20211225231941.GB83649@eureka.lemis.com> <20211225234337.cWiBV%steffen@sdaoden.eu> <20211227034321.GH83649@eureka.lemis.com> In-Reply-To: <20211227034321.GH83649@eureka.lemis.com> From: Rudi Blom Date: Mon, 27 Dec 2021 11:06:07 +0700 Message-ID: To: "Greg 'groggy' Lehey" Subject: Re: [COFF] What is your prompt? X-BeenThere: coff@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Computer Old Farts Forum List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coff Content-Type: multipart/mixed; boundary="===============4738636132658968030==" Errors-To: coff-bounces@minnie.tuhs.org Sender: "COFF" --===============4738636132658968030== Content-Type: multipart/alternative; boundary="000000000000ac2a7305d418d366" --000000000000ac2a7305d418d366 Content-Type: text/plain; charset="UTF-8" Just 'uname' is not specific enough. On SCO UNIX 3.2V4.2 uname defaults to 'uname -s'. On AlphaServer with Digital UNIX 4.0g or TRU64 V5.1B I get 'OSF1' as answer. On HP-UX 11.23/11.31 I get 'HP-UX'. Even if I do a 'uname -m' I may still do additional 'uname [-]' for other specifics. Of course a 'uname -a' and 'set -- $*' would be a possibility. On Mon, 27 Dec 2021 at 10:43, Greg 'groggy' Lehey wrote: > 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@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 > -- The more I learn the better I understand I know nothing. --000000000000ac2a7305d418d366 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Just 'uname' is not specific enou= gh. On SCO UNIX 3.2V4.2 uname defaults to 'uname -s'. On AlphaServe= r with Digital UNIX 4.0g or TRU64 V5.1B I get 'OSF1' as answer. On = HP-UX 11.23/11.31 I get 'HP-UX'.

Eve= n if I do a 'uname -m' I may still do additional 'uname [-<a= rgument>]' for other specifics. Of course a 'uname -a' and &= #39;set -- $*' would be a possibility.

On Mon, 27 Dec 2021 at 10:4= 3, Greg 'groggy' Lehey <grog@l= emis.com> wrote:
On Monday, 27 December 2021 at=C2=A0 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 she= ll
> scripts still have similar structure as I know how to 'cut and pas= te'.
>
> These scripts are run remotely via a 'homegrown' client-server= setup. Many
> should run on different UNIX environments and therefore have near the<= br> > beginning an OS check. Depending on that I can set PATH and anything e= lse
> important.
>
> #
> # check what type of OS this system runs on
> #
> OST=3D`uname -m`

That's the architecture.=C2=A0 Wouldn't just `uname` be better?=C2= =A0 I have:

=C2=A0 case `uname` in
=C2=A0 Linux)
=C2=A0 =C2=A0 PATH=3D.:~:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr= /sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/Photos/Tools
=C2=A0 =C2=A0 export SHELL=3D/bin/bash
=C2=A0 =C2=A0 ;;

=C2=A0 NetBSD)
=C2=A0 =C2=A0 PATH=3D.:~:/usr/pkg/bin::/usr/local/bin:/usr/local/sbin:~/bin= :/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/usr/loc= al/gnu-autotools/bin:~:/Photos/Tools
=C2=A0 =C2=A0 export SHELL=3D/usr/pkg/bin/bash
=C2=A0 =C2=A0 ;;

=C2=A0 FreeBSD)
=C2=A0 =C2=A0 PATH=3D.:~:/home/local/bin:/usr/local/bin:/usr/local/sbin:~/b= in:/usr/bin:/usr/sbin:/bin:/sbin:/Photos/Tools:~
=C2=A0 =C2=A0 export SHELL=3D/usr/local/bin/bash
=C2=A0 =C2=A0 ;;
...

And yes, lm, if you're looking, there's really a /usr/local/bitkeep= er
in there.=C2=A0 It's been years, but I don't tidy these things up v= ery
often.=C2=A0 I only just removed mosaic from my fvwm2 config menus.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.=C2=A0 If your Microsoft mail program
reports problems, please read
http://lemis.com/broken-MUA.php


--
The more I learn the better I understand I know = nothing.

--000000000000ac2a7305d418d366-- --===============4738636132658968030== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ09GRiBtYWls aW5nIGxpc3QKQ09GRkBtaW5uaWUudHVocy5vcmcKaHR0cHM6Ly9taW5uaWUudHVocy5vcmcvY2dp LWJpbi9tYWlsbWFuL2xpc3RpbmZvL2NvZmYK --===============4738636132658968030==--