gawk

pattern scanning and processing language

copy
31
0
gawk 'BEGIN { print "hello, world" }'Print hello world

details |

copy
9
0
gawk '{ sum += $1 }; END { print sum }' myfile.txtCount the number of $1 in myfile.txt

details |

copy
6
0
gawk -F: '{ print $1 }' /etc/passwdlist all the users in passwd use : as a separator

details |

copy
0
0
gawk -F'\t' ....

source | details |

copy
4
0
gawk 'BEGIN { print "line one\nline two\nline three" }'Print the following adding a new line to each \n

details |

copy
2
0
gawk '{ print $1, $2 }' myfile.txtPrint the first two words, separated by a space of the file myfile.txt

details |

copy
1
0
gawk --version),

source | details |

copy
2
0
gawk 'BEGIN { print _"hello, world" }'

source | details |

copy
1
0
gawk -F\t ...

source | details |

copy
0
0
gawk 'BEGIN { print "hello, world" }'

source | details |

copy
0
0
gawk --gen-po -f myprog.awk > myprog.po

source | details |

copy
5
0
gawk 'END { print NR }' myfile.txtCount the number of lines in a file

details |