Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!mcdchg!usenet From: usenet@mcdchg.UUCP Newsgroups: mod.os.unix Subject: getopt command problem: doesn't re-quote Message-ID: <236@mcdchg.UUCP> Date: Fri, 13-Mar-87 10:12:28 EST Article-I.D.: mcdchg.236 Posted: Fri Mar 13 10:12:28 1987 Date-Received: Sat, 14-Mar-87 07:08:59 EST Sender: usenet@mcdchg.UUCP Lines: 19 Approved: usenet@falkor.UUCP Don't know if anyone's brought this up before, but the getopt command seems to have a bit of a problem. It doesn't "re-quote" arguments, so they get broken up incorrectly when parsed by the shell. Example: getopt x: -x "a test" produces: -x a test -- instead of: -x "a test" -- Resulting in: Instead of: $1=-x $1=-x $2=a $2=a test $3=test $3=-- $4=-- Even "sh" itself recognizes this problem, and provides re-quoting via "$@" . Since writing one's own getopt program is trivial on a system with the getopt call, this is more of a major annoyance than a problem. So, my questions: 1) Any portable workarounds (I can't think of any)? 2) Have any of the standards groups thought of proposing that this be fixed?