Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!HPLABS.HP.COM!hpsemc!bd From: hpsemc!bd@HPLABS.HP.COM (bob desinger) Newsgroups: comp.mail.mh Subject: Re: Here's a way to expire old messages Message-ID: <8802102006.AA05618@hpsemc.HP.COM> Date: 10 Feb 88 20:06:54 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 47 (Greg Fowler pointed out that my message got rather severely truncated along the way. I think my original reply may have been truncated on my machine; we ran out of filespace in /usr/spool one night, around the time I sent this message. But on with the show.) Jerry Peek's original comment went something like this: > But "set -v" *does* show redirection... at least on our BSD-like > Bourne shell. My reply went on for a few screens showing the differences between "set -x" and "set -v". Here's the condensed version. Our Bourne shell on System V (HP-UX) does exactly what Jerry's does, so -v is the right flag to use here. Use -x when you're debugging and you want to see which lines are actually being executed. Use -v when you'd rather see the whole script, including redirection. The -x flag prints each line as it executes, omits lines that aren't executed because a condition is false, and never mentions any redirection. The -v flag prints the whole script as it's being parsed, including lines that won't be executed, and shows redirection. To be more concrete, the script: if true then echo It was true on `date` >>results else echo It was false, yow! >>results fi prints when executed with `sh -x': + true + date + echo It was true on Wed Feb 10 11:58:48 PST 1988 Notice no redirection, but trace lines showing which lines were executed (the file "results" contains what you'd expect). Using `sh -v' produces: if true then echo It was true on `date` >>results else echo It was false, yow! >>results fi This is probably closer to the output that Dave would like to see in his notification, so I agree with Jerry: use -v instead of -x. -- bd