HP3000-L Archives

November 2004, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Paul Christidis <[log in to unmask]>
Reply To:
Date:
Thu, 4 Nov 2004 15:59:43 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (89 lines)
John,

The command file being executed out of the UDC 'inherits' the 'stdin' of
the UDC (tempfile in your example).

One way to still have the 'invoked' command files remain 'interactive' is
to explicitly redirect their input to $stdin.  See below:

        ...
        file x=$stdin
        INPUT _r5;prompt="Enter YES or NO: "   < *x
        ...

Regards
Paul Christidis


HP-3000 Systems Discussion <[log in to unmask]> wrote on 11/04/2004
02:53:28 PM:

> I'm using Donna's version of SHUTDOWN, somewhat modified for my own
> purposes, and here's my question.
>
> The SHUTDOWN command must be in a UDC in order to call the actual MPE
> SHUTDOWN command later.  The SHUTDOWN script (it's on Jazz if anyone
cares
> to take a look) invokes every script in the SDCMD group in alphabetical
> order by calling another UDC using a listfile as STDIN to that script.
>
> What I've found is that any scripts in the SDCMD group cannot actually
> accept user input via the :INPUT command.  I suspect this is because of
the
> way the UDC calls the other UDC that invokes the scripts.
>
> The work-around is pretty easy -- just put the :INPUTs in the UDC
itself.
> But can anyone else think of a way around this limitation?  It would be
> nice not to have to think about this and change the UDC if we decide to
> start putting in shutdown scripts that require user input.
>
> If I'm being unclear, I'll repost with specific details, but the gist
is:
>
> ***
> SHUTDOWN
> ...
> do some stuff
> ....
> listfile @.SDCMD,6 >tempfile
> sdproc <tempfile
>
> ....
> ****
> SDPROC
> setvar _sp_eof finfo(hpstdin,'eof')
> while setvar(_sp_eof,_sp_eof-1) >= 0
>   if setvar(_sp_rec,rtrim(input())) > ''
>     errclear
>     continue
>     xeq !_sp_rec
>     if hpcierr <> 0
>       echo
>       echo ERROR: Trouble with !_sp_rec
>       echo        !hpcierrmsg
>       deletevar _sp_@
>       escape !hpcierr
>     endif
>   endif
> endwhile
>
> I guess the logical explanation for :INPUT failing within the scripts
that
> are being invoked is that the process running the scripts isn't actually
> interactive.  Is that it?
>
> Donna, sorry I simplified your UDC above, trying to keep this short but
> still readable.
>
> John Testa
> SLPS Homewood
> 708-647-4346
> [log in to unmask]
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2