in reply to Re^2: Net::OpenSSH can't change working directory
in thread Net::OpenSSH can't change working directory
Tried your code and it worked. I used 'cd /usr/local/bin; ls' and got the expected listing
You haven't said if you tried 'cd /' or something else like 'ls' as commands. Did that work or not?
The FAQ of Net::OpenSSH informs us that the module uses ssh in command mode, i.e. it logs in for each new command string. Using Expect together with Net::OpenSSH or other ssh modules is offered as a solution, it should use interactive mode.
You could also just join commands together with ';', for example "cd /usr/local/bin; ls; mv $somefile $otherfile". Low-tech but simple.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Net::OpenSSH can't change working directory
by josh803316 (Beadle) on Jul 17, 2010 at 16:45 UTC |