zsh-users
 help / color / mirror / code / Atom feed
From: Atom 'Smasher' <atom@suspicious.org>
To: zsh-users@sunsite.dk
Subject: Re: coloring STDERR to terminal
Date: Sun, 27 Jun 2004 20:36:22 -0400 (EDT)	[thread overview]
Message-ID: <20040627201330.R27888@willy_wonka> (raw)
In-Reply-To: <20040628000617.GW96475@episec.com>

-----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-----


  reply	other threads:[~2004-06-28  0:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-27 23:22 Atom 'Smasher'
2004-06-28  0:06 ` ari
2004-06-28  0:36   ` Atom 'Smasher' [this message]
2004-06-29 15:43 ` Bart Schaefer
2004-06-29 16:08   ` Vincent Lefevre
2004-06-29 17:14     ` Bart Schaefer
2004-06-30  7:09       ` Vincent Lefevre
2004-06-30 10:52         ` Bart Schaefer
2004-06-30 11:43           ` Vincent Lefevre
2004-06-30 12:01             ` Vincent Lefevre
2004-06-30 16:56             ` Bart Schaefer
2004-07-01 18:14               ` Vincent Lefevre
2004-07-02  0:11                 ` Bart Schaefer
2004-07-02 12:42                   ` Vincent Lefevre
2004-07-02 21:32                     ` Bart Schaefer
2004-07-20  9:10                     ` Atom 'Smasher'
2004-07-20 16:10                       ` Bart Schaefer
2004-07-20 19:27                         ` Atom 'Smasher'
2004-07-20 21:15                           ` Bart Schaefer
2004-07-20 23:30                             ` Wayne Davison
2004-07-21  3:15                               ` Bart Schaefer
2004-07-21  6:23                                 ` Wayne Davison
2004-07-21  7:30                                   ` Bart Schaefer
2004-07-21 13:19                                   ` Vincent Lefevre
2004-07-30 11:50                     ` Andy Spiegl
2004-07-30 23:44                       ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040627201330.R27888@willy_wonka \
    --to=atom@suspicious.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).