On Thu, Aug 08, 2002 at 11:08:22AM -0700, Alex Paschal wrote:
>> What I would like to do is start a dsmadmc process at the start of my Perl
>> program, issue commands to it and read the results via named pipes. I
>> have already accomplished this, but the only thing that doesn't work is
>> the entry of the username and password. Since I don't want to enter the
> You'll need to use an EXPECT type of module.
Thanks, but that's not where the problem lies. I can send and receive
commands and output just fine over named pipes, the thing is that I can't
send the password over a named pipe. A detailed description of the problem:
I create the named pipes:
joskam@tridw1:~/drm $mkfifo dsmadmc-in
joskam@tridw1:~/drm $mkfifo dsmadmc-out
After that, I start dsmadmc with redirection to/from the pipes:
joskam@tridw1:~/drm $dsmadmc <dsmadmc-in >dsmadmc-out
On another terminal, I make sure to get the output:
joskam@tridw1:~/drm $cat dsmadmc-out
This outputs nothing at first.
On yet another terminal, I connect to the input pipe of dsmadmc, but don't
send anything yet:
joskam@tridw1:~/drm $cat >dsmadmc-in
Now, on the output pipe the copyright message from dsmadmc show, but on the
terminal I started dsmadmc the "Enter your user id:" message shows. In
other words, that message is not redirected over the named pipe. I send my
user id over the input pipe, and immediately after that, on the terminal I
started dsmadmc on, the following appears (note that I don't get the chance
to even try to enter the password):
ANS1051E Invalid password
ANS1051E Invalid password
ANS1051E Invalid password
On the output pipe, dsmadmc complains:
ANS8023E Unable to establish session with server.
ANS8002I Highest return code was 137.
When I supply my username and password on the dsmadmc commandline with the
-id and -pas options, the pipes work great. If I supply for example "q pr"
on the input pipe, the output appears on the output pipe. When I send EOF
to the input pipe, everything is nicely closed.
But I don't want to supply my username and password via the command line.
--
Jurjen Oskam
PGP Key available at http://www.stupendous.org/
|