You can use one of the built-in BASH variables to detect BASH. Much faster
If you need to detect other PASE shells vs QSH, then trying to run
/QSYS.LIB/QSHELL.PGM/UNAME.PGM is one way, though I never particularly
cared for it (it was and still is a hack).
----- Original message -----
From: John Yeung <gallium.arsenide@xxxxxxxxx>
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [IBMiOSS] installing with iACS package
Date: Thu, Jun 13, 2019 12:08 PM
On Thu, Jun 13, 2019 at 11:56 AM Kevin Adler <kadler@xxxxxxxxxx> wrote:
> Jack, can you please stop repeating these outdated instructions:
> # detect if we're in a PASE shell /QSYS.LIB/QSHELL.LIB/UNAME.PGM >
> /dev/null 2>&1
> if [ $? != 0 -a "$SHELL" != "/QOpenSys/pkgs/bin/bash" ] then
> exec /QOpenSys/pkgs/bin/bash
> Please, for the love of everything, use the flippin' procedure:
No doubt those instructions are outdated, but I think there is still
some demand for being able to detect whether a session was invoked via
(1) QSH on 5250, (2) QP2TERM on 5250, or (3) SSH with proper TTY
capability. As such, it would be nice to have a .profile that works
sensibly under all conditions.
Personally, given the horrific interaction between 5250 and the
RPM-based bash, I would prefer not to invoke bash automatically unless
coming in from SSH.
> Also, your example .profile doesn't even show how to set the PATH
> in it. Refer to
Well, to be fair, the example .profile may have been written with the
assumption that if you want to ultimately be using bash, you'll have a
.bashrc and set your PATH there.
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
Help support midrange.com by shopping at amazon.com with our affiliate
As an Amazon Associate we earn from qualifying purchases.