#!/usr/bin/perl #use strict refs; #use warnings; use Expect; use Net::SSH::Expect; my $ssh = Net::SSH::Expect-> new ( host => "MYHOST", password => "user123", user => "user123", raw_pty => 1, log_file => "log_file" # this line actually got my head spinning in right direction ); my $login_output=$ssh->login(); sleep 1; my $output=$ssh->exec("pwd"); warn "$output\n"; $ssh->exec("/sbin/fuser -k 9090/tcp"); my $output1=$ssh->exec("cd /home/tecnomen/JanusSIM2.0"); warn "$output1\n"; $ssh->exec("javac Atsi2.java"); sleep 1; warn "starting the ATSI script\n"; my $output3=$ssh->exec("java Atsi2 &"); sleep 10; warn"$output3\n";