LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shell script for jar utility (https://www.linuxquestions.org/questions/linux-general-1/shell-script-for-jar-utility-769461/)

jaydeepnp 11-16-2009 10:29 AM

Shell script for jar utility
 
I have jar utility, I want to create schell script to execute this jar utility and also provide inputs for the jar utility from the shell script is this possiable? How?

Please help

Jaydeep

catkin 11-16-2009 10:40 AM

You can do it from a shell script exactly the same way you do it from the command line.

knudfl 11-16-2009 11:34 PM

Code:

#!/bin/bash

cd <path-to-file.jar>

exec java -jar <file.jar>

chmod +x start-script.sh
.. and .. 'cp start-script.sh /usr/local/bin/'
.. make a Desktop Entry ( Icon ) to start the application.
.....

jaydeepnp 11-18-2009 02:37 AM

Thanks Catkin & knudfl for your response.

I am herewith want to rephrase my question.

See I am having jar utility which currently I am running from command prompt. This utility asks for 5 inputs and then does its work after all inputs.

Now I want to create shell script for executing the jar utility and also provide the inputs say by reading data from separate file. Is this possible? how?

Once again thanks a lot for your response.

Jaydeep

catkin 11-18-2009 08:11 AM

Depending on how the jar utility works it may be possible with a here document (scroll down to sections 3.6.6 and 3.6.7).


All times are GMT -5. The time now is 12:32 AM.