-1

Basically what I need is, I want to run a shell script present on remote linux machine along with that I need to pass one list collection as an argument to that script and fetch the result back in java code to print and store in object.

Tano
  • 1,285
  • 1
  • 18
  • 38
Java_learner
  • 29
  • 1
  • 6

1 Answers1

1

I think Old post in stackoverflow will help you on this

How to run Unix shell script from Java code?

Run shell script from Java Synchronously

Community
  • 1
  • 1
Abhilash Arjaria
  • 142
  • 2
  • 10
  • 1
    I have seen this but I am not sure, how to connect to remote linux machine before executing this code. – Java_learner Sep 13 '16 at 03:31
  • 1
    Try This Solution :: http://www.codesandscripts.com/2014/10/java-program-to-execute-shell-scripts-on-remote-server.html – Abhilash Arjaria Sep 13 '16 at 05:21
  • 1
    JSch is an excellent library for supporting remote connections over ssh, including the execution of remote commands (or shell scripts). There are numerous examples of how to use JSch at JSch Examples – Abhilash Arjaria Sep 13 '16 at 05:23
  • 1
    Thanks for the information. I will try this and respond after that. Can you please also specify in which scenario we use process builder.. I mean when we are using process builder how connection is made with linux machine. Thanks again for the help! – Java_learner Sep 13 '16 at 05:53