This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes pass arguments from korn shell script to java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "pass arguments from korn shell script to java" Watch "pass arguments from korn shell script to java" New topic
Author

pass arguments from korn shell script to java

malki sabag
Greenhorn

Joined: Nov 22, 2011
Posts: 7
Hi all!
im trying to pass values from my script to java (to the main method).
i have seen in different forums how its done but im still not successful.
my script is very long so ill put only whats important:

im getting input from the user like this
print -n "Enter a number "; read NUM

before running the command im preparing it like this:
COMMAND="${JAVA_HOME}/bin/java"
COMMAND="${COMMAND} ${JAVA_DEBUG} ${JAVA_ARGS}"
COMMAND="${COMMAND} com.pack.css.impl.myClass $NUM"

and then i run the command
the class works fine, all the calls are correct but in the main(String[] args) the args array is null

i know the array is null because i am looking at it in a debug mode

what am I doing wrong??
any suggestions??

THANKS A LOT
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

What gets displayed when you type "echo $COMMAND"?


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pass arguments from korn shell script to java
 
Similar Threads
can anyone help me to fix this little problem
Values of Hash Map to be 2-dimensional array
Main function return code
read numbers from the standard input into an array
Can an arraylist hold null reference or not using add(Index i, Object obj) method?