× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In QSH, use the "whence" command:

whence rm
/bin/rm
$

ls -l /bin/rm
lrwxrwxrwx 1 QSYS 0 27 Nov 21 2013 /bin/rm ->
/QSYS.LIB
/QSHELL.LIB/RM.PGM
$

"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 12/01/2016
03:08:57 PM:

From: Manuel Chaviano <manny@xxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Date: 12/01/2016 03:14 PM
Subject: Re: Question about QShell commands
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>

El Wed, 30 Nov 2016 17:02:45 -0600
Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> escribió:
Manuel,

That'd be true if we were interested in PASE, but the OP (as shown in
the subject line) is interested in QShell. Since 'which' is a PASE
utiiity, it will not find all QShell tools.

But, the IBM-supplied ones are in /usr/bin, so you can do:

STRQSH

$ ls -l /usr/bin/rm

It will tell you that rm is a symlink to /QSYS.LIB/QSHELL.LIB/RM.PGM.
You can then do:

WRKPGM QSHELL/RM

to see what sort of *PGM object it is. If it had been a PASE
program,
then your technique would work nicely.

-SK


On 11/30/2016 3:33 PM, Manuel Chaviano wrote:

"file" will give you some details about the file type.

call QP2TERM

You need to provide the fill path: use "which" to determine where is
"rm"
located:

> which rm
/QOpenSys/usr/bin/rm

Now you can use "file":

> file /QOpenSys/usr/bin/rm
/QOpenSys/usr/bin/rm: executable (RISC System/6000) or object
module

...an AIX RS/6000 object or module


I just tried using STRQSH:

$
> which rm
/QOpenSys/usr/bin/rm
$
> file /QOpenSys/usr/bin/rm
/QOpenSys/usr/bin/rm: symbolic link to ../../QIBM/ProdData/
OS400/PASE/bin/r
m
$

I navigate to the symbolic link:

> pwd
/QOpenSys/QIBM/ProdData/OS400/PASE/bin
$

and the "file" command gives me a similar result to QP2TERM:
> file rm
rm: executable (RISC System/6000)
$

"echo $PATH" [within STRQSH]:
/usr/bin:.:/QOpenSys/usr/bin
"echo $PASE_PATH" [within STRQSH]:

/QOpenSys/usr/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/QOpenSys/usr/local/bin:.

Looks like from STRQSH:
1) "which" is a PASE command.
2) PASE commands will not use $PATH from STRQSH, but its own $PASE_PATH
3) Typing "rm" will execute the ILE version (how can I be sure?)

There is no "which" program in QSHELL.
--
L8R


__
///
__ ///
\\\///
\XX/ FreeBSD 10-STABLE


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.