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

How to redirect output without escape sequences to a file



Hi,

I've modified my PS4 so it contains a little bit of colour[1]. When I 
redirect the debug output to a file ("&> trace.log") this naturally 
contains the escape sequences literally[2] (which makes the output 
somehow unclear).

Is there a way to either strip the escape sequences when redirected to a 
file or to modify PS4 when stderr is redirected to a file?

Thanks in advance,
Thorsten
[1] PS4='%{\e[1;36m%}+%{\e[m%}%1N[%i]%{\e[1;36m%}:%{\e[m%} '
[2] +slpsnoop.sh[53]: print



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