getopt command problem: doesn't re-quote
robert at rabbit1.UUCP
robert at rabbit1.UUCP
Tue Feb 17 14:27:08 AEST 1987
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
More information about the Comp.unix.questions
mailing list