Solved

shell script question

Posted on 2012-03-14
5
213 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
Comment Utility
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
Comment Utility
is "$@" only goes for  WASPreUpgrade or for the other two application too(WSLauncher, WSPreLauncher)? thanks.
0
 

Author Comment

by:DESEI-SELB
Comment Utility
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
Comment Utility
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
Comment Utility
thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now