4

The idea is to run remote python or bash script by clicking run button in eclipse.

I found something very close here: https://stackoverflow.com/a/5979831/932965

Then execute external tool: ssh user@rometesite -c "java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n Main"

But I don't know how to run some remote script by external tool. Maybe there is other way then external tool... Anyway I can run script by ssh command:

ssh user@server 'bash ~/workspace/testscript.sh'

But I'm not able to run it by external tool. I set
Location: /usr/bin/ssh
Arguments: "user@server 'bash ~/workspace/testscript.sh'"

I got connected but testscript.sh didn't do anything.

testscript.sh source:

#!/bin/bash

touch testfile
Community
  • 1
  • 1
bandit
  • 839
  • 4
  • 10
  • 26
  • It's probably not causing your issue, but you don't need to explicitly call bash if the execute bit is set on the file. `ssh user@server ~/workspace/testscript.sh` should work fine. – Swiss Jul 27 '12 at 08:34

1 Answers1

2

I tried it locally and I believe it might be related to the working directory in the remote machine.

First, I changed the command as suggested by Swiss:

Location: /usr/bin/ssh

Arguments: user@server ~/workspace/testscript.sh

(Note I didn't put double quotes since the user/host is one argument and the command to execute is another argument.)

Try using the following script to print the working directory and then check if no file has been created in the displayed directory:

testscript.sh source:

#!/bin/bash

echo "$PWD"
touch testfile
anol
  • 8,264
  • 3
  • 34
  • 78
  • Finally I had to check your solution, because today I work remote from home. It's working. Thank you very much. I should just add that all scripts that method are running from remote home directory. – bandit Dec 21 '12 at 09:20