![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comparing PID values of 2 Files in shell Options | marconi | Shell Programming and Scripting | 2 | 12-19-2007 01:02 PM |
| Scripts that take String options | hanhanbib | Shell Programming and Scripting | 2 | 10-18-2007 11:52 PM |
| Adding PATH variable in the startup scripts | rajanishshetty | UNIX for Dummies Questions & Answers | 5 | 03-02-2007 12:51 PM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-12-2006 02:27 AM |
| Options for csh shell | luiz_fer10 | UNIX for Dummies Questions & Answers | 10 | 06-03-2002 04:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Adding -options to shell scripts
I'm sure this is something simple I am overlooking somehow. I'd like the ability to pass -options into my shell scripts. For example my file called "input.sh" I can do the following:
root# ./input.sh 1 and it will result: root#./input.sh 1 You passed me a 1 Just like an init script, etc. I would like to be able to do: root# ./input -m 1 and have the -m specify a different result in the case statement. Like: root# ./input.sh -m 1 You passed me a -m 1 #! /bin/bash case "$1" in 1) echo "You passed me a 1" ;; 2) echo "You passed me a 2" ;; *) commands; ;; esac Thanks for any suggestions as always guys. ![]() |
|
||||
|
Quote:
![]() It does indeed seem much more complicated than it really is. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|