I have a java program that runs as a service in linux box. I have shell script file that has the following line to start the program.
$EXEC -home "$JAVA_HOME" -cp "$CLASS_PATH" -outfile "$LOG_OUT" -errfile "$LOG_ERR" -pidfile "$PID" $1 $CLASS
$CLASS_PATH has class path
$CLASS has the name of main class
EXEC="/usr/bin/jsvc"
I can start and stop the service using following commands
service myscriptfilename start
service myscriptfilename stop
Now I added a new argument to my program called "myflag" . It works fine on windows box . Now I am having difficulty passing the new argument to my program on my linux box using the shell script.
Now I am starting my service as
service myscriptfilename start myflag
I can get the value of myflag using $2 in shell script. I am trying to figure out how do I pass that to my program
How can i pass my "myflag" to my program from shell script in the following line?
$EXEC -home "$JAVA_HOME" -cp "$CLASS_PATH" -outfile "$LOG_OUT" -errfile "$LOG_ERR" -pidfile "$PID" $1 $CLASS