Solved

shell script question

Posted on 2012-03-14
5
215 Views
Last Modified: 2012-04-10
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,
0
Comment
Question by:DESEI-SELB
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:simon3270
ID: 37721500
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.
0
 

Author Comment

by:DESEI-SELB
ID: 37721607
is "$@" only goes for  WASPreUpgrade or for the other two application too(WSLauncher, WSPreLauncher)? thanks.
0
 

Author Comment

by:DESEI-SELB
ID: 37721973
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,
0
 
LVL 19

Accepted Solution

by:
simon3270 earned 50 total points
ID: 37722637
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.
0
 

Author Closing Comment

by:DESEI-SELB
ID: 37828324
thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Guacamole and browser performance 1 87
Exchange 2010 unable to mount DB due to corruption 11 121
Hacked File Timestamps 4 64
Reset Root Password on CentOS 6 4 56
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question