From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18625 invoked from network); 28 Jun 2004 00:37:40 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 28 Jun 2004 00:37:40 -0000 Received: (qmail 11968 invoked from network); 28 Jun 2004 01:47:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2004 01:47:05 -0000 Received: (qmail 4123 invoked by alias); 28 Jun 2004 00:36:58 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7607 Received: (qmail 4113 invoked from network); 28 Jun 2004 00:36:57 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 28 Jun 2004 00:36:57 -0000 Received: (qmail 10822 invoked from network); 28 Jun 2004 01:46:34 -0000 Received: from rso.suspicious.org (HELO research.suspicious.org) (69.55.224.62) by a.mx.sunsite.dk with SMTP; 28 Jun 2004 01:46:26 -0000 Received: (qmail 56744 invoked by uid 1002); 28 Jun 2004 00:36:47 -0000 Date: Sun, 27 Jun 2004 20:36:22 -0400 (EDT) From: Atom 'Smasher' To: zsh-users@sunsite.dk Subject: Re: coloring STDERR to terminal In-Reply-To: <20040628000617.GW96475@episec.com> Message-ID: <20040627201330.R27888@willy_wonka> References: <20040627190433.Q27888@willy_wonka> <20040628000617.GW96475@episec.com> X-OpenPGP-KeyID: 0xB88D52E4D9F57808 (4096-RSA) X-OpenPGP-Fingerprint: 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 X-OpenPGP-URL: http://smasher.suspicious.org/pgp.txt MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 27 Jun 2004, ari wrote: > atom@suspicious.org mentioned: > >> i'm not sure if this is possible without patching some sources, but here's >> what i want to do... every time STDERR is directed to a terminal, i want >> to filter it through _something_like_ this: >> awk '{print "^[[91m"$0"^[[0m"}' > > Perhaps not what you're looking for, since the effect is asynchronous, > but you _could_ do this with a variation of: > > ERRFIFO=$HOME/.stderr-$TTY.fifo > [ -p $ERRFIFO ] || mkfifo $ERRFIFO > awk '{print "^[[91m"$0"^[[0m"}' <$ERRFIFO 1>&2 & > > exec 2>$ERRFIFO > > Execution of this segment would, of course, need to be restricted to > once per terminal session. =================== i guess this demonstrates what you mean by "asynchronous": { echo -n a ; echo -n b >&2 ; echo c ; echo d >&2 ; } (on freeBSD, "echo -n" suppresses the newline. i don't think that option is portable across all flavors of *nix) the results are ~not~ what i would've though ;) it also doesn't do well at all with this command: gpg < clearsigned_file which outputs some lines as STDERR, other lines as STDOUT. and this isn't working anything the way i'd expect it to: time date > file_stdout 2> file_stderr it seems that i can't redirect STDERR unless i run the command in curly-braces or parenthesis... { time date ; } > file_stdout 2> file_stderr back-quotes don't even work. ...atom _________________________________________ PGP key - http://atom.smasher.org/pgp.txt 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- "Cryptography is like literacy in the Dark Ages. Infinitely potent, for good and ill... yet basically an intellectual construct, an idea, which by its nature will resist efforts to restrict it to bureaucrats and others who deem only themselves worthy of such Privilege." -- Vin McLellan, A Thinking Man's Creed for Crypto -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.6 (FreeBSD) Comment: What is this gibberish? Comment: http://atom.smasher.org/links/#digital_signatures iEYEARECAAYFAkDfaBMACgkQnCgLvz19QeN4+ACfQoj6iDKdInD31W7FnsAvPRlx 9EsAn0FNB0lBJqoHeUKnqrU/y7jceQDd =X7Y4 -----END PGP SIGNATURE-----