I tried to search but didn't get any answers. An option with a multiple argument always returns an array. 1. while getopts ":i:d:s:f: " In part, consult Using getopts in bash shell script to get long and short command-line options. (Man page definitions below). An empty array if the option is not set and no default is given, an array with only the default value if not set and default value is given or an array of all values given. How can I check if a directory exists in a Bash shell script? Hi, Does the order of argument and non-argument command line parameters matter to getopts? Removing the space between the p and the... (3 Replies) Each player has a process associated with him which shares a segment of memory in which the player's structures are stored, and these structured are accessed by the 'server' program and handled there. 178|9995. I have tried as below command in my script but with no luck Is it possible to get a script that uses getopts to accept options and arguments in any order? The getopt module is a parser for command-line options based on the convention established by the Unix getopt() function. For example, if argument to script is a directory, I will need to specify -R or -r option along with any other options (myscript -iR mydir or myscript -ir mydir or myscript -i -r mydir or myscript -i -R mydir), in case of file only -i is sufficient (myscript -i myfile). with a getopts line in my script of getopts p:cs opt a command line of