Link to home
Start Free TrialLog in
Avatar of ams7503
ams7503

asked on

Perl -ssh- Illegal seek

Hi ;
I have a perl script that does a whole bunch of stuff and at the end ssh's to a remote server and runs a script from there.
It looks like it is correctly ssh and running the commands.However, I get a Illegal Seek error- what does this mean?
This is how I ssh and run the cmds
`ssh -v -C root@sigma.com  "cd $dbpath/setup;source setenv.sh;cd../scripts; ./export_data.sh"` or die "Can not run ssh $!\n";
What does illegal seek mean?
Avatar of ams7503
ams7503

ASKER

when I take away the or die "Can not run ssh $!\n";
- the script runs fine without any problems
I think the system call is returning non 0, but you are looking for 0 on succeds on success r  die.  Try this:
$command = q{ssh -v -C root@sigma.com  "cd $dbpath/setup;source setenv.sh;cd../scripts; ./export_data.sh"};
$return_code = system($command);
# check return_code to see what defines success or failure.
Avatar of ozo
Are you getting "Can not run ssh illegal seek"?
the or will happen when the `` returns "0" or ""
and $! will be whatever happened to be left in $! from earlier
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial