home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!spsgate!mogate!newsgate!wdc!mario
- From: mario@wdc.sps.mot.com (Mario Nigrovic)
- Subject: BOURNE - exec >/dev/null 2>&1 wierdness
- Message-ID: <1992Dec30.190932.7963@newsgate.sps.mot.com>
- Sender: mario@wdc (Mario Nigrovic)
- Nntp-Posting-Host: 223.199.55.4
- Organization: Motorola Western MCU Design Center, Chandler Arizona
- Date: Wed, 30 Dec 1992 19:09:32 GMT
- Lines: 36
-
- Hello,
- I am writing a Bourne shell script and am having some strange
- interactions seemingly caused by exec >/dev/null 2>&1. Let me
- provide some details:
-
- Sun Sparc2, 4.1.1b
-
- I have a function called verify_tape which internally might just
- want to create a log file. After I've created it, and before I can
- mail the log file to the administrator, I want to close it, right?
- So I do the exec >/dev/null 2>&1. Seems to work just fine, except
- that MUCH later on, when I run dump(8), all it's output gets lost,
- DESPITE THE FACT that I've exec'd to a new log file before then.
-
- I fixed this above problem by kicking the function calls into
- subshells, but this still leaves me confused. Furthermore, I am now
- having a similar problem with Mail, because again I've closed the
- log file before mailing it.
-
-
- This whole thing seems to me to be a bit of a mess; is there
- really anything dangerous (or permanent) about redirecting the shell's
- outputs to /dev/null?
-
- Please respond via E-Mail, and I'll summarize if requested. The
- correct email address appears below. Thanks for your time.
-
- Mario
-
- Mario Nigrovic <mario@wdc.sps.mot.com> voice: (602) 821-4264
- Motorola Western MCU Design Center fax: (602) 821-4058
- * - - - - - - - - - - -*- - - - - - - - - - - *
- I profoundly believe it takes a lot of practice to become a moral
- slob.
- -- William F. Buckley
- * - - - - - - - - - - -*- - - - - - - - - - - *
-