Um, that IS where the problem lies. Right, you can send commands and output fine on STDIN and STDOUT via the named pipes. However, the DSMADMC command doesn't use STDIN for the username and password. I'm not sure exactly what it does use, but it's not your standard input, even if redirected. You can see similar behavior with FTP. That's why you'll need the EXPECT module to be able to put in the password. The EXPECT module does weird TTY stuff to be able to handle whatever input the password prompt does use, just like your term tty.
Alex Paschal Storage Administrator Freightliner, LLC (503) 745-6850 phone/vmail -----Original Message----- From: Jurjen Oskam [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 1:43 AM To: [EMAIL PROTECTED] Subject: Re: Communicating with dsmadmc via named pipes 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/
