Awk: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
<source lang=bash>
<source lang=bash>
$ cat test.txt | awk -F':' '{print $1}'
$ cat test.txt | awk -F':' '{print $1}'
</source>
== Statement ==
=== for ===
<source lang=awk>
</source>
=== while ===
<source lang=awk>
while (condition)
  body
</source>
</source>


[[category:programming]]
[[category:programming]]

Revision as of 12:36, 26 July 2016

Overview

AWK 내용 정리

Options

-F

Delimiter 설정을 바꾼다. 기본값은 ' '(공백)이다. <source lang=bash> $ cat test.txt | awk -F':' '{print $1}' </source>

Statement

for

<source lang=awk> </source>

while

<source lang=awk> while (condition)

 body

</source>