例如,当使用 ack 在源文件中搜索代码时,输出高亮显示。但是,如果将输出通过管道传输到本地文件,则会丢失代码亮点。我们是否有命令行工具来保留它?
要理解我的意思:
$ git clone https://github.com/koehlma/jaspy
$ cd jaspy/
$ ack func ./* # you see the high light for each match
$ ack func ./* > output.txt
$ cat output.txt # you don't see the high light
Run Code Online (Sandbox Code Playgroud)