4,576,902 th visitor since 2017.2.1 ( Today : 781 )
Computer ???
No. 498
Name. swindler
Subject. grep pipe color 문제
Main Cate. Linux
Sub Cate.
Date. 2021-12-15 09:38
Hit. 687 (121.134.199.74)
File.
grep Exception * 과 같이 하면
보통은 Exception 글자에 색상이 표기된다.

그런데

grep Exception * | grep -v ignore 처럼 하면 색상이 사라진다.

--color 라는 옵션이 있는데,
역시나 pipe를 거치면 사라진다.

--color=alwyas 라는 옵션을 주면

grep --color=alwyas Exception * | grep -v ignore

ignore라는 글자가 다시 출력된다. ignore에 칼러코드가 포함되면서 grep -v 에서 안 거리는 문제인 것 같다.


grep Exception | grep -v ignore | grep --color Exception
이렇게 처음과 똑같이 마지막에 한번 더 걸어주면 그 시점에서 color 표기가 가능하다.


[바로가기 링크] : http://coolx.net/cboard/computer/498



Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog