=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2333 - May 22, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

GREP을 이용하여 빈줄 지우기

awk에 익숙하지 않지만 단순 아스키 파일에서 빈줄을 지우는 빠르고 쉬운 방법을
원하는 사람들은 'grep'과 결합하여 'cat'을 사용하는 것이 효과적인 방법이다.

cat file1 | grep -v '^$' >file2
mv -f file2 file1

----------------------------------------------------------------------

DELETING BLANK LINES USING GREP

For thos who are not familiar with
awk, but still want a quick and easy
way of removing blank lines from a
flat ascii file, remember that the
use of 'cat' in conjuction with
'grep' is just as effective.

cat file1 | grep -v '^$' >file2
mv -f file2 file1
반응형
Posted by She쥐포s

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

최근에 올라온 글

최근에 달린 댓글

글 보관함