Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!uunet!mcsun!ukc!mucs!logitek!grep!vic From: vic@grep.co.uk (Victor Gavin) Newsgroups: comp.sys.hp Subject: Documented bug in Bourne shell functions Message-ID: <1991Mar05.182511.13289@grep.co.uk> Date: 5 Mar 91 18:25:11 GMT Reply-To: vic@rainbow.grep.co.uk (Victor Gavin) Organization: Grep Limited, LEEDS, UK Lines: 29 I found a ``bug'' in the Bourne shell which HP has documented and refuses to fix. The bug is that after you've invoked a shell function, the positional parameters of the running shell are reset to the arguments passed to the function. When I called it into HP, I was informed that this is the documented behaviour and that back in 85/86 an SR had been raised internally (4000022558) to look into it and that recently (in the last 6 months) another SR (1650123364) had been raised to look into it. The labs had replied that it won't be fixed as the shell will change for Posix compliance anyway -- whenever that arrives :-( Here's the script, invoke with ``sh ./script abc def'' or ``ksh ./script abc def'' to see it working properly. ............................................................................... func() { : } echo "Args before function call are \"$*\"" func laser echo "Args after function call are \"$*\"" ...............................................................................