Execute a shell script in a Jar File

Hello,

In UNIX, I have an application in wich i want to execute a shell script.

I would like to put that script in the jar file and be able to execute it from the main application.

I can get the URL of the script (something like jar:file:....) but I can't find a way to then execute this script from the Runtime.exec command.

Does someone know how to do that ?

Many thanks.

[411 byte] By [ProZa] at [2007-10-2 23:53:02]
# 1

> Hello,

>

> In UNIX, I have an application in wich i want to

> execute a shell script.

> I would like to put that script in the jar file and

> be able to execute it from the main application.

Then do it - write an application that can execute a script. But usually, executing a script is something the shell does, so it'll be the shell that needs to be able to read the file. You have to extract it, or you have to manually issue the commands and handle the piping, using Runtime.exec().

CeciNEstPasUnProgrammeura at 2007-7-14 16:38:52 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks for your answerI extracted the script and piped it to a "/bin/ksh -e " commandI did not thought to piped it ;)Thanks a lot
ProZa at 2007-7-14 16:38:52 > top of Java-index,Java Essentials,Java Programming...