Monks,
Again I find myself needing your wisdom. I am trying to use Net::SSH::perl to execute multiple commands. It's not working.
my $ssh = Net::SSH::Perl->new("mybox.myhost.com");
$ssh->login($user, $pass);
$ssh->cmd( "export SYBASE=\"/usr/local/sybase/OC\"" );
$ssh->cmd( "export AUTOSYS=\"/usr/platinum/autosys\"" );
$ssh->cmd( "export AUTOUSER=\"/usr/platinum/autouser\"" );
$ssh->cmd( "export __std_err_file=/dev/null");
$ssh->cmd( "export __command=NIL");
$ssh->cmd( "export AUTO_JOB_PID=0");
$ssh->cmd( "export AUTO_JOB_NAME=\"myjob\"");
$ssh->cmd( "export APP_ROOT=");
my($stdout, $stderr, $exit)=$ssh->cmd( "autorep -q -J myjob#init#t" );
print "$stdout\n";
When this script actually runs, I get an error message basically telling me that all my exports above did not take place, because it can't find sybase. Anyone know what I am doing wrong?
Thanks!
2006-04-22 Retitled by Corion, as per Monastery guidelines
Original title: 'Net::SSH::perl'
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.