in reply to capturing error messages from backticks or system
results -#!/usr/bin/perl -w use strict; my $results = `net use f: \\\\SERVER\\c\$ 2>&1`; print "results contains - $results\n";
On NT, your whole error message may be in STDERR. It's not in 2000 though.C:\dev>map.pl results contains - System error 1202 has occurred. An attempt was made to remember a device that had previously been reme +mbered.
Hope this helps..
Rich
update: I'm an idiot. The entire message is in $results. So forget I mentioned that the whole thing wasn't sent to STDERR. I assumed it wasn't because of the new lines. I guess that's what I get for thinking! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: capturing error messages from backticks or system
by tye (Sage) on Aug 28, 2001 at 23:43 UTC |