psyk0tic has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I'm where with a 'little' problem... I've written a script in which, besides other things, I need to access a CLI based on java and execute commands inside it.
To accomplish this I've used IPC::Open2. Code snippet below:
# *** # * Access HiQ4200 CLI in expert mode my($chld_out, $chld_in); my $pid = open2($chld_out, $chld_in, '$RTP_HOME/bin/RtpAdmCli -u srx - +x'); # *** # * Create the SOAP export file print $chld_in ("soapExport \"-f=$SOAP_EXP_PATH/expEP%Y%m%d.txt -NM=En +dpoint\"", localtime); # Wait for the process to finish waitpid( $pid, 0 );
When testing the script, I connected to the server via ssh and the script gave this error. I've researched and it seems the error appears when we try to execute an interactive shell in an non interactive context. Because by default ssh gives an non interactive execution context I thought the problem was in ssh.
I tried to fix accessing with -t paramenter (ssh -t ...), but it doesn't fixed it.
So, as the problem seemed to be ssh I tried to execute the script accessing via serial connection locally to the server... And the problem persists!...
I really don't know how to solve this, everything I've read don't fixed it.
Some additional info: There's no definition of any stty in the files:
/root/.cshrc /root/.profile /.profile /etc/.loginSome pages advice to redefine stty in one of this files.
I've read the oter threads on this and none of it gives a working fix.
It's possible the problem has something to do with Open2?
Any advice on this? Any help will be much appreciated!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: stty: : Invalid argument
by salva (Canon) on Jul 08, 2010 at 09:57 UTC | |
|
Re: stty: : Invalid argument
by Anonymous Monk on Jul 08, 2010 at 10:01 UTC | |
|
Re: stty: : Invalid argument
by psyk0tic (Novice) on Jul 13, 2010 at 16:45 UTC |