Sys 5 shell functions - argument problem?

Steve Rumsby steve at warwick.UUCP
Fri Nov 29 01:47:15 AEST 1985


Script started on Thu Nov 28 14:33:06 1985
{steve} foo () {
... echo foo $*
... }
{steve} set - original args
{steve} echo $*
original args
{steve} foo new args
foo new args
{steve} echo $*
new args
{steve} 
script done on Thu Nov 28 14:33:44 1985

This is a Sys 5 r2v2 shell. Is this a feature of all Sys 5 shells? Has anybody
fixed it? Looking through the source, what is happening is that the shell is
replacing the current args with those of the shell function, rather than
saving/restoring them. The fix can't be too difficult, so maybe I'll attempt it
myself (stay tuned for another thrilling installment.... ), but if a "real" fix
exists (ie. an AT&T one) I'd rather use that (for compatability and all that
rubbish).

BTW. this shell is running under 4.1bsd (whaddaya mean, nobody runs 4.1
anymore). Not that this is likely to have anything to do with this problem, but 
you never know. AT&T might have some sneaky code in there somewhere :-)

#ifdef BSD
	crapon(something);
#endif

-- 

					Steve Rumsby.

				    ...!ukc!warwick!steve.



More information about the Comp.unix.wizards mailing list