🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Dave Mason Thu, 27 Jul 1989 15:47
Weird /bin/sh bug
#40
Author: Dave Mason
Date: Thu, 27 Jul 1989 15:47
30 lines
1559 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads