Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!cbmvax!hutch!rabbit1!robert From: robert@rabbit1.UUCP Newsgroups: comp.unix.questions Subject: getopt command problem: doesn't re-quote Message-ID: <274@rabbit1.UUCP> Date: Mon, 16-Feb-87 23:27:08 EST Article-I.D.: rabbit1.274 Posted: Mon Feb 16 23:27:08 1987 Date-Received: Tue, 17-Feb-87 23:16:21 EST Distribution: na Organization: Rabbit Software Corp., Malvern PA Lines: 25 Keywords: getopt command problem 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? -- Robert Oliver Rabbit Software Corp. (215) 647-0440 7 Great Valley Parkway East ...!ihnp4!{cbmvax,cuuxb}!hutch!robert Malvern, PA 19355 ...!psuvax!burdvax!hutch!robert