• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to run a unix script

 
atlantis sundar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I wanted to run a unix script in java application which is running in windows OS. Can any one tell how to do that with a sample code. And how to make the interaction between UNIX and windows. I am using HP UNIX. Please help me in this. Urgent.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"atlantis atlantis", please check your private messages for an important administrative matter.
 
Henry Wong
author
Marshal
Pie
Posts: 21008
77
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
atlantis sundar wrote:
I wanted to run a unix script in java application which is running in windows OS. Can any one tell how to do that with a sample code. And how to make the interaction between UNIX and windows. I am using HP UNIX. Please help me in this. Urgent.


Well, it would help if you tell us what are you running. You start off by saying that you are running Java on Windows, and then later say that you are using HP Unix. Well, which is it?

Henry
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's both: my understanding is that there's a Java application on Windows from which the OP wants to run a script on an HP Unix box.
 
Henry Wong
author
Marshal
Pie
Posts: 21008
77
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can also be read as a script that works on HP, that the OP want to run on Windows... regardless, we need clarification. And more information, depending on what the clarification is.

Henry
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed. The request for how to do the interaction between Windows and Unix is what put me on that path.

Seems like a lot to deal with for an "urgent" request ;)
 
atlantis sundar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes, the java application is running on windows OS, and frm that application i want to trigger the unix script for which I am using HP-UNIX.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you need to use a protocol like Telnet or SSH. The HP UNIX machine must have a server running for one of these; I recommend SSH over Telnet because it is more secure.

Check out Apache Commons Net for a good Telnet client, and a library like JSch for SSH.
 
Henry Wong
author
Marshal
Pie
Posts: 21008
77
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend doing it without Java first. Can you use telnet? Or does Window need to install something like Putty? Heck.... can you even ping the HP box from the windows box?

Once you confirm that the network connection is okay, and that that a particular protocol works, then you should look into the Java API that does that protocol.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic