Path: 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 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