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.
JavaShell Scripting

Avatar of undefined
Last Comment
CEHJ

8/22/2022 - Mon
CEHJ

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

Open in new window

liyy

ASKER
thanks CEHJ,

Is it possible generate outfile like "${1}+result.doc" ?
ASKER CERTIFIED SOLUTION
CEHJ

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
CEHJ

:)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes