getopts multiple arguments

I am running korn shell on Solaris 5.8. Is it possible to use getopts to process multiple options together? File 2 Your code was actually very, very close to working. DESCRIPTION. Having seen our hello world program in a number of forms so far such as the simple hello and then using if we will now extend this further. Thinking for a moment about how we compile the source code we use the option -o to specify the output file. 1. The only thing you were missing is that getopt only expects you to consume one argument after -l, and therefore continues command line parsing following the first argument to -l.Since you're going behind its back and pulling off more arguments, you have to tell getopt where to start parsing the command line again. The OPTARG variable is not mentioned in the ENVIRONMENT VARIABLES section because it does not affect the execution of getopts ; it is one of the few ``output-only'' variables used by the standard utilities. I need to create a shell script having the menu with few options such as with a getopts line in my script of getopts p:cs opt a command line of