From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079034715495.tru64-unix-managers.marc@archive.invalid> From: Richard Sharpe Date: Sun, 10 Jan 1999 02:09:28 +0000 To: tru64-unix-managers Subject: SUMMARY: Problems with Bourne Shell and getopts X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079034715495 Don't know whether or not this justifies a summary, but here goes. I asked: > I have seen reports that suggest that the Bourne shell under Digital UNIX > has problems with $OPTIND when using getopt. > > When I last looked, there seemed to be a problem if there are no command > line parameters to a shell, $OPTIND seems undefined. > > However, reports I have seen suggest that $OPTIND may be undefined in all > cases. Thanks to Tom Blinn and Charles Richmond, and some experimentation, I found that indeed, getopts is not well supported in sh under DU. Tom pointed out that under DU 4.0 and later, sh has two versions. One (the better one) is POSIX/XPG4 compatible and supports what I want. The older one does not. ksh supports everything I need. Now to see how to rectify the problem. Under DU, ksh seems to be /usr/bin/posix/sh, which is the POSIX/XPG4 sh. Regards ------- Richard Sharpe, sharpe@ns.aus.com, NIC-Handle:RJS96 NS Computer Software and Services P/L, Ph: +61-8-8281-0063, FAX: +61-8-8250-2080, Samba, Linux, Apache, Digital UNIX, AIX, Netscape, Stronghold, C, ...