You can use one of the built-in BASH variables to detect BASH. Much faster
that way.
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
 [2][2] ;

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.

John Y.
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [3] ;
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [4] ;.

Help support by shopping at with our affiliate
link: [5] ;



Visible links

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.