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



I think I know what the problem is, but I'm not sure how to fix it.

First, it's invoking the shell script...I think it's because I invoke
the shell...here's my script (blah.sh):

#! /QopenSys/bin/sh
sftp -b /tmp/xxxxsftp.txt someuser@somehost
exit

I create the .txt file dynamically. It consists of puts and an exit, like this:

put /app/hrs20071207/400_071207_0002.tar
put /app/hrs20071207/400_071207_0002.trg
exit

But I think my problem is that I'm using qsyseteuid to set the
effective user id that I run the script under. It's causing a
different job to be invoked. So my OVRDBF is in the calling program,
but the blah.sh is running in a different job. Maybe that's why it's
going to QPRINT.

On Dec 7, 2007 12:32 PM, Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> wrote:
Hmmm... First of all, you're using QP2SHELL to invoke a shell script,
but, as far as I can tell, you haven't invoked the shell at all. Your
call should look more like this:

CALL QP2SHELL PARM('/QOpenSys/usr/bin/sh' +
'-c' +
'/home/user1/blah.sh')

The first parameter is the shell (in this case, 'sh', which is the
Bourne shell). The second parameter, -c, tells it to run a command.
The third parameter, is the command to run -- in this case, your shell
script.

The OVRDBF might be failing due to an activation group issue. If you're
issuing OVRDBF from the default activation group, it should work just
fine because it'll use OVRSCOPE(*CALLLVL) by default. If you're running
an ILE CL program from a different activation group, however, your
OVRDBF won't work because QP2SHELL runs in ACTGRP(*NEW) and therefore
will be in a different activation group than your override. (Unless you
explicitly code the OVRSCOPE)

There's another API called QP2SHELL2 which is identical to QP2SHELL,
except that QP2SHELL2 runs in ACTGRP(*CALLER).

Having said all of that... I don't understand why your STDOUT would go
to QPRINT?! The default (if you don't do an override) is to display it
on the screen... so it's weird to me that it'd go to QPRINT unless
you've told it to. What is QIBM_USE_DESCRIPTOR_STDIO set to?




Michael Ryan wrote:
I'm doing these overrides:

OVRDBF FILE(STDOUT) TOFILE(MYLIB/STDOUT)
OVRDBF FILE(STDERR) TOFILE(MYLIB/STDERR)

and invoking PASE with a shell script:
CALL PGM(QP2SHELL) PARM('/home/user1/blah.sh')

and I would expect the output of the script going to the files.
However, STDOUT (and probably STDERR - which is why I'm trying the
override) is going to QPRINT.

What am I doing wrong? Thanks...


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



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.