![]() |
|
|
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 |
| Passing options to a bash script | DeCoTwc | Shell Programming and Scripting | 3 | 05-21-2008 02:43 AM |
| comparing PID values of 2 Files in shell Options | marconi | Shell Programming and Scripting | 2 | 12-19-2007 01:02 PM |
| Handeling multiple options in script | virus_stinger | Shell Programming and Scripting | 2 | 05-23-2006 02:31 PM |
| Adding -options to shell scripts | sysera | Shell Programming and Scripting | 4 | 06-21-2005 11:56 AM |
| Options for csh shell | luiz_fer10 | UNIX for Dummies Questions & Answers | 10 | 06-03-2002 05:24 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Adding options to a shell script
I want to add options to my shell script but having problems, my code so far is; Code:
#!/bin/bash
lflag=
iflag=
while getopts 'l:i:' OPTION
do
case $OPTION in
l) lflag=1
lval="$OPTARG"
;;
i) iflag=1
ival="$OPTARG"
;;
?) printf "Usage: %s: [-a] [-b value] args\n" $(basename $0) >&2
exit 2
;;
esac
done
shift $(($OPTIND - 1))
When I try to run this with options set I get the error: Warning: unknown mime-type for "1" -- using "application/*" Error: no such file "1" Any ideas? I think my syntax is probably wrong somewhere, thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|