I am calling a java program from shell script. Shell script contains one variable which needs to use in java program.
Shell Script:
for s in 0 1
do
javac -cp $CLASSPATH ./src/*.java
java -cp $CLASSPATH Test
done
Test.java
main() {
sValue = ...; // here I need to get value from shell
someMethod(sValue) {
. ... .
}
}
shell script has variable s with value 0 and 1. I need to use this variable in java program Test.
In my program I am can't pass this value as argument as "java -cp $CLASSPATH Test $s". So please provide some other solution.