2015/06/12

Filter STDERR only

$ cat warn.pl
#!/usr/bin/env perl
print STDERR "warnings all over the place\n";
print STDOUT "standard output to file descriptor 1\n";

$ exec 3>&1; ./warn.pl 2>&1 >&3 3>&- | awk '{print $5}' 3>&-; exec 3>&-
standard output to file descriptor 1
place

No comments:

Post a Comment