×
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.
Hi Jerry,
Just in case it's not clear: Whether something is or is not in your
home directory has nothing to do with whether you can call it
(unqualified). Whether you can call something without listing the
folders it's located in is based on your PATH (or PASE_PATH). So if
/home/jerry is in your PATH, you can run your script without qualifying
it. Putting the home directory in your PATH is not a common way of
doing things on Unix systems. More typically, you'd have a directory
named /home/jerry/bin that'd you'd have in your path. On Unix systems,
the home directory is used for a plethora of different things, and it'd
be too hard to manage if you used it as a place to store executable
scripts. I mention all of this because I'm not sure whether or not it's
clear to you... but it's probably not the problem at hand.
The problem at hand is that you haven't told PASE which shell to use.
Without a shell, there's no command-line environment to interpret your
shell script. The searching of the PATH is part of the logic in the
shell, as is environment variables, wildcards, etc. IF you don't start
up a shell, then you have to run an actual executable program (and one
that doesn't need the services supplied by the shell.)
When you call qp2term with no parameters, it automatically selects the
default shell for you, and starts it up. That's why your script works
from that -- because you DO start a shell in that case.
However, when you run qp2shell without specifying the shell as the first
parameter, no shell is started, so your script won't work.
Try doing this instead:
CALL QP2SHELL PARM('/QOPENSYS/bin/sh' '-c' 'tstcat.sh')
The first parameter is the name of the shell -- /QOPENSYS/bin/sh. That
starts up the shell. The next parm, -c, tells the shell to start a
command. Finally, the last parameter is the command-line that the shell
is to run.
Hope that helps.
Jerry Draper wrote:
I logon to a v5r4 i5 as jerry.
From a command line I do a:
CALL PGM(QP2SHELL) PARM('tstcat.sh')
tstcat does this:
#! /QopenSys/bin/sh
cd /xfer/tst//inbound
cat * >lckbox.txt
exit
tstcat resides in the /home/jerry folder
I can run tstcat from qp2term after I do a cd and it works fine.
From a command line it says:
i5/OS PASE program not found or in use. Path name is tstcat.sh.
Error loading i5/OS PASE program tstcat.sh. See previous messages.
I made sure the permissions were ok.
The records in tstcat.sh end in LF so that's ok.
I can run it from inside qp2term.
The problem is that it is not finding the tstcat.sh in the home folder.
I know this works.
What am I missing?
Jerry
As an Amazon Associate we earn from qualifying purchases.