ack3
ack3 copied to clipboard
redirect ack output into a file results in non-printable characters appearing in the output file
Hi ack team
When do redirect ack output into a output file there are non-printable characters appearing in the output file as below - [0m:[35m1077[0m:
I do not see this issue with grep. Is there a way this can be avoided...?
engrvns
How are you calling ack? Please give an exact command line you're using. Also, do you have an .ackrc file somewhere?
Chances are, you're adding --color
to the command line options, or you have --color
in an .ackrc file. You can use ack --dump
to see where you might be bringing in options you don't mean to be.
That's correct. O am adding --color option
If you add the --color
option, then you will get color codes in your output, even if you are redirecting to a file.
By default, ack will output color codes to the screen, but not when redirecting to a file. So if you take out the --color
, you should get the results you want.
So they should be able to put --no-color
on the command line when
redirecting, right? That will override the .Ackrc file setting
(Also, the same less -iR
used with --pager=
should work to view the
saved color in the files. )
Yes, --no-color works as well.
Yes --no-color worked in redirection to avoid non-printable chars.