🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1580

Re: What's set -n for ?

#1580
From: Martin Weitzel
Date: Mon, 22 Oct 1990 18:32
25 lines
1302 bytes
In article <1295@tardis.Tymnet.COM> jms@tardis.Tymnet.COM (Joe Smith) writes:
>Q: What is "-n" good for in /bin/sh?
>A: "sh -nv shell_script_being_debugged".

True answer, but there's an interesting bug, at least in some flavours
of UNIX SysV: A script containing

	....
	while read a
	do
		... something ....
	done
	....

hangs, even if you "debug" it with the -n option of the shell set. Note
further, that if you substitute an `if' for the `while' in the above
example, everything is fine.

Though I can understand that bugs like this may slip into a program
(execution of the internal command `read' is not properly inhibited)
I allways wondered about the differences depending on the if/while
context. Is there anybody out there with more insight (esp. someone 
with access to the shell sources?)
-- 
Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83
Technical Details
Message-ID: <939@mwtech.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!unido!mikros!mwtech!martin
References: <23880001@hpopd.HP.COM> <1295@tardis.Tymnet.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!unido!mikros!mwtech!martin
From: martin@mwtech.UUCP (Martin Weitzel)
Newsgroups: comp.unix.shell
Subject: Re: What's set -n for ?
Message-ID: <939@mwtech.UUCP>
Date: 22 Oct 90 18:32:01 GMT
References: <23880001@hpopd.HP.COM> <1295@tardis.Tymnet.COM>
Reply-To: martin@mwtech.UUCP (Martin Weitzel)
Organization: MIKROS Systemware, Darmstadt/W-Germany
Lines: 25