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

Re: How to redirect output without escape sequences to a file



On May 8, 2011, at 3:27 PM, Thorsten Kampe wrote:

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

not sure about those, but "less -R" (or "less -r") may help--they make less output ANSI color sequences (or all control sequences) literally, instead of with caret notation, so you'd actually see the same colors you do on the console.
-- 
Aaron Davies
aaron.davies@xxxxxxxxx


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