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

Some 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!


In reply to stty: : Invalid argument by psyk0tic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.