Could someone explain how do i get the options separated from the arguments. My problem is that i have a lot of options and in all of those options i need to have the parameters available to use in that option and all the others. How can i take the arguments before i cycle throw the options?
That is a good example thank you.
But that's not the example that I have. I have something like this
MyScript.sh -sd -r -e Dir1/Dir2 Dir3/Dir4
This exemplifies that MyScript receives one or more options and one or more directories (the arguments for the script are folders where I need to look for files according to the options).
First I have the options and after that I have the arguments. But after I run the first option I have to have all the arguments already available in a variable or something. Is there a way to accomplish this without the getops? I know i have to use shift.