MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » July 2008

Re: pase home folder



fixed

Thanks for the clarification on protocol using the /user/home folder.

There still is something missing because this IS working on another system and I am NOT specifying the shell as you suggest.

Here is the snippet that works:

CALL PGM(QP2SHELL) PARM('filrcvarc.sh')

I remember running some script when I installed 5799PT1 and I am wondering if that set up some environment.

In any event (my techie brain fully engaged now) how can the above work without specifying the shell?

Jerry

Quoting Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>:

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




--
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.








Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact