Unseting positional parmaters from inside a program

Maarten Litmaath maart at cs.vu.nl
Tue Jan 23 11:47:40 AEST 1990


In article <481d9fde.14a1f at force.UUCP>,
	covertr at force.UUCP (Richard E. Covert) writes:
\...
\args=`./setargs "ab:" "avar:bvar" "$@" `
\...
\_______________ screen dump of test_setargs __________________
\args is avar=1;bvar='bs string';set -- 
\...

The problem:

	set --

doesn't unset the arguments (set $# to 0), it does nothing, which is a bug
(dubious feature) IMHO.  Solution:

	set x <the remaining arguments, if any>
	shift

Followups to comp.unix.questions.
-- 
  What do the following have in common:  access(2), SysV echo, O_NONDELAY?  |
  Maarten Litmaath @ VU Amsterdam:  maart at cs.vu.nl,  uunet!mcsun!botter!maart



More information about the Comp.lang.c mailing list