Greetings wise ones. I am trying to set my display to a windows machine and then kick off a command and run it in the background on a solaris 8 machine. The code works fine as far as setting the display and starting the xterm goes but, drops the ball on putting the process in the background. Has anyone run into this problem and or found a solution? As always any help is greatly appreciated. Below is a simple example of what I am trying to do. The script fist starts exceed in passive mode to allow my display to be set.
use Net::SSH::W32Perl;
$host = "$ARGV[0]";
$user = "$ARGV[1]";
$pwd = "$ARGV[2]";
$cmd = 'setenv DISPLAY 10.1.42.151:0.0; xterm &';
&startexceed;
print "EXCEED STARTED\n";
my $ssh = new Net::SSH::W32Perl($host, protocol => '2', debug => + 1);
$ssh->login($user, $pwd);
my ($out, $err, $exit) = $ssh->cmd($cmd);
print "OUT => $out\n\n";
print "ERR => $err\n\n";
print "EXIT => $exit\n\n";
sub startexceed{
$exceed = "C:\\Program Files\\Hummingbird\\Connectivity\\9.00\\Exc
+eed\\exceed.exe";
use Win32::Process;
$Result = Win32::Process::Create($ProcessObj,
"$exceed",
"$exceed -m passive",
0,
NORMAL_PRIORITY_CLASS,
".")|| die "\nCould not create exceed\.exe\n";
$ProcessObj->Wait(10);
$ProcessObj->GetExitCode($exitcode);
unless($exitcode == "259"){
die "exceed exited with a return code of $exitcode\n";
}
}
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.