Link to home
Start Free TrialLog in
Avatar of liyy
liyy

asked on

java command line scripting

Hi,

Java expert please help.

I have a java command running Mac OS X Server platform and I don't want a staff run command line as they just a user

the command line program requires 3 variables, file1.doc file2.doc and outputfile.doc, sample like below:

java -jar xxxx.jar compare "file1.doc"  "file2.doc"  "outputfile.doc"

How can I enable file1.doc and file2.doc variable so that user can type a script like:

program-script file1 file2 and automatically produce outputfile.doc.

file1 and file2 means that the filename are variable name.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

How about this?
#!/bin/bash
java -jar xxxx.jar compare "${1}"  "${2}"  "outputfile.doc"

Open in new window

Avatar of liyy
liyy

ASKER

thanks CEHJ,

Is it possible generate outfile like "${1}+result.doc" ?
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)