Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

trap stdout and stderr and format without adding to command line?


I'm attempting to find a way to arbitrarily format stdout and stderr by default.


% ls
  [stdout]  file00  file03  file06  file09  file12  file15  file18
  [stdout]  file01  file04  file07  file10  file13  file16  file19
  [stdout]  file02  file05  file08  file11  file14  file17

The closest I've gotten is Jeroen van Wolffelaar's annotate script[1] and trying to wrap it with preexec (where much learning occurred and adventure was had).

I'm guessing I could compile a custom shell to always prefix the command with the annotate script. Alternately could stdout/stderr be modified by the shell itself?

Second question, somewhat related. I noticed the annotate script would treat output differently. For instance; stripping coloring, treating 'ls -C' like 'ls -1', etc.


[1]: http://jeroen.a-eskwadraat.nl/sw/annotate/annotate

Messages sorted by: Reverse Date, Date, Thread, Author