• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question regarding Shell Script  RSS feed

 
Neel Chow
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure whether I should post this question here. I apologise if the question is out of the scope of this forum.

I have written a shell script for installing our product in unix environment. The script file take some parameters as arguments.

./install.sh /usr/websphere http://foobar/config wpsadmin wpsadmin

As you can see, this could be error prone for users. What I want to do and what I have seen in some other scrits, to use some specifier. I want the arguments to be position independent.
eg:

./install.sh -in /usr/websphere -url http://foobar/config -user wpsadmin -pwd wpsadmin

Can anybody tell me, how do I do this?
Thanks
-Avijit
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the "getopt" program. Start with "man getopt".
 
Neel Chow
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!