Thanks for both responses, but as I said in my original post, removing the space doesn't help, and putting the no-arg option first works fine. It's putting the -s after the -p5 (or -p 5) that doesn't.
Subbeh, can you try running ./test.ksh -p 5 -s and see what you get?
Thanks.
Never mind. Subbeh's test script works for me when I reverse the order. It must be something else in my script.
I'll investigate further.
---------- Post updated at 02:06 PM ---------- Previous update was at 11:51 AM ----------
OK, my C programming knowledge was tripping me. I was putting "break"s at the end of each case, which of course took me right out of the "while" loop.
Anyway, thanks for playing.