We help IT Professionals succeed at work.

shell script question

DESEI-SELB
DESEI-SELB asked
on
I have a script was not sure what does it do:

"$JAVA_HOME/bin/java" \
  "$OSGI_INSTALL" "$OSGI_CFG" \
  $EXTRA_X_ARG \
  $CONSOLE_ENCODING \
  -Dcom.ibm.websphere.migration.serverRoot="$WAS_HOME" \
  -Dws.ext.dirs="$WAS_EXT_DIRS" \
  -Dwas.install.root=$WAS_HOME \
  -Duser.install.root=$USER_INSTALL_ROOT \
  $PERF_JVM_OPTIONS \
  $WAS_LOGGING \
  $EXTRA_D_ARG \
  -classpath "$WAS_CLASSPATH":"$WAS_HOME"/derby/lib/derby.jar com.ibm.wsspi.bootstrap.WSPreLauncher \
  -nosplash  -application com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.migration.WASPreUpgrade "$@"


the reason I am asking is that I want to run the command WASPreUpgrade with an argument. where do I add that argument?

thanks,
Comment
Watch Question

BRONZE EXPERT

Commented:
The script already passes any arguments to the WASPreUpgrade program as "$@" at the end of the last line.

Just add the argument(s) to the command line.

Author

Commented:
is "$@" only goes for  WASPreUpgrade or for the other two application too(WSLauncher, WSPreLauncher)? thanks.

Author

Commented:
also, the WASPreUpgrade is not being run from the command line but from a different script. so can I just add the argument at the end aftger "$@"?

thanks,
BRONZE EXPERT
Commented:
If this script is being called from anaother one, you acn either add the argument to the calling script, or can add it here - the last bit of code would then read:

    com.ibm.ws.migration.WASPreUpgrade "$@" your_argument

I'm not sure what java does when you pass three classes to it - I weould expect it to pass the arguments only to the last one.

Author

Commented:
thanks.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.