Path: utzoo!utgpu!jarvis.csri.toronto.edu!dptcdc!tmsoft!mason From: mason@tmsoft.uucp (Dave Mason) Newsgroups: comp.bugs.sys5 Subject: Weird /bin/sh bug Keywords: System 5r2.0v2 on ICM3216 Message-ID: <1989Jul27.154746.19050@tmsoft.uucp> Date: 27 Jul 89 15:47:46 GMT Reply-To: mason@tmsoft.UUCP (Dave Mason) Followup-To: comp.bugs.sys5 Organization: TM Software Associates Inc., Toronto, Ontario, Canada Lines: 30 I have the following shell program called 'uw' to tell me what is going on with uucp: cd /usr/spool/uucp ls LCK* 2>/dev/null echo tail ${@+"$@"} SYSLOG of course the 'echo' is only there for debugging purposes. Now, if I say 'uw' from my login shell, I get: LCK..dial LCK..dptcdc tail LCK..dial LCK..dptcdc SYSLOG !!! If I first create a subshell, then it does what I expected: LCK..dial LCK..dptcdc tail SYSLOG If I create a new shell explicitly, e.g. with 'sh uw' then it works, but if it is a clone of the login shell, then I get the erroneous results, even if I try '(cd;(cd;uw))'. This implies to me that some garbage is left lying around by the login process that causes the shell to go a bit bonkers. I have a work-around for this case, although the semantics are subtly different: TF="${@+$@} SYSLOG" cd /usr/spool/uucp ls LCK* 2>/dev/null echo tail $TF (the only time it's different is if I say 'uw ""', but as the only intended argument is 'uw -f', it's OK here.) So, I don't need a fix, just thought I'd see whether the bug exists elsewhere or has been fixed. ../Dave