Mac os X - ssh command
I am trying to build a little applications and want to be able to use the unix shell to run ssh
so i can run the ssh command and read and write to the connection.
I tried to use the Runtime with the exec command but i get an error saying ssh is unknown command, but i can use commands like "ls" and get the output
any ideas?
cheers
[362 byte] By [
Lopala] at [2007-10-3 3:04:53]

If you're at a terminal window and you can type ssh and it works, then ssh is in your PATH. However, the environment you get when you use Runtime.exec is not the same as in a terminal window. It won't have run all the .zshrc, etc. files that you get with the terminal, so the PATH is different.
You'll need to either specify the full path, like runtime.exec("/usr/bin/sss blah") or else exec a shell script that sources the proper .zshrc or whatever files.
Note, however, that you still might have problems. ssh might be one of those programs that only accepts input from a terminal, not from arbitrary pipes or streams.
jverda at 2007-7-14 20:54:57 >
