passing arguments

Hi
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>

In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after "/file" not to be an argument but something the is passed if /file is an argument to the script. I currently have a case structure like the below

parseargs ()
{
for i in $CMDLINE_ARGS
do
case $i in
def )
DO_THIS = yes
;;

/file \)

 ;;

}

I basically want the script to read the directory location that is passed and do something with it, without treating it as an argument. I hope my explanation is clear for someone to help me on how I could implement this. Thanks.

read the getopts man page. Traditionally unix command lines look like this

command -o arg1 -p -q arg2 <arg for command>

Options start with a - and may or may not have arguments, plus they can occur in any order. Hence getopts

getopts tutorial - The 60 second getopts tutorial

Going through the getopts examples, it looks to expect a single character as an option, is that correct? In my case the options are more than a single character as in def hij etc. An example I saw gives something like "while getopts ":mnopq:rs" Option" in my case I beleive I cannot pass something like
"while getopts ":defhij/file:" Option ". Can you pls. clarify? Thanks.

Are you using bash - it accepts long options with two dashes --thisisalongopt
Options are supposed to have at least one in front of them....

not bash, using sh. Thanks.