unix and linux
awk에서 substring 체크
'김용환'
2015. 7. 20. 20:18
awk에서 index() 함수를 이용해서 substring이 포함되었지를 확인할 수 있다.
$ cat > test.file
c1 place_1234 5
$ awk 'index($1, "place") == 0 {print}' test.file
c1 place_1234 5
$ awk 'index($1, "place") == 1 {print}' test.file
// 결과 없음