home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!nstn.ns.ca!dragon.acadiau.ca!merlin!peter
- From: peter@merlin.acadiau.ca (Peter Steele)
- Subject: Re: What's the difference between `command` and system('command')?
- Message-ID: <peter.716295183@merlin>
- Sender: news@dragon.acadiau.ca
- Nntp-Posting-Host: merlin
- Organization: Acadia University
- References: <sasswb.716131013@k2> <1992Sep10.183530.21405@news.eng.convex.com> <peter.716216984@merlin> <1992Sep11.161827@is.morgan.com>
- Date: Sat, 12 Sep 1992 10:53:03 GMT
- Lines: 26
-
- >|> Where does error output go (i.e., stderr)? I have an application
- >|> where I want to capture error output, not stdout.
-
- >How about
-
- > @lines = `cmd 2>&1`;
-
- >This runs cmd with stderr redirected to stdout. It works with ksh - I
- >don't know about csh.q
-
- What's happens to normal stdout in this case? Is it lost? The application
- I'm writing has to maintain normal stdout as well as stderr. Here's what
- I'm doing:
-
- dump 0f - /somefs | compress | dd of=/dev/somedev
-
- I want to collect the stderr output of each of these commands. The
- only way I can think of doing this in perl is:
-
- `dump 0f - /somefs 2>1.err | compress 2>2.err | dd of=/dev/somedev >3.err`
-
- and then open and extract the info I want from the three files that are
- created. Is this a reasonable way to do this in perl?
- --
- Peter Steele Unix Services Manager peter.steele@acadiau.ca
- Acadia Univ., Wolfville, NS, Canada B0P 1X0 902-542-2201 Fax: 902-542-4364
-