awk

  1. Aknot

    Using awk to extract IPs with exact match on string?

    Is there a way to use a exact match on the condition in awk? This is what I have: awk '$11 == "200" && index($9, "/example") {print $1}' /var/log/httpd-access.log | sort -n >> /tmp/ips.list This catches /anotherdirectory/example too as it contains /example. Is there a way to prevent this...
  2. E

    Solved awk strftime undocumented - one-true-awk/awk.1 vs awk(1)

    Based on my answer here with: $ pkg query %t-%n | sort | awk -F"-" '{ OFS="-"; $1=strftime("%Y-%m-%d %H:%M:%S", $1); print $0 }' strftime in awk is not documented in awk - 14.1R man page On 14.1-RELEASE-p6 (I've cleared every "*awk" from installed packages) I have: [1] ~ # cat...
  3. M

    Other BSD awk regexp atoms with {n,m} bounds

    I notice that FreeBSD's (and OpenBSD's) awk treats a repetition qualifier like "{2,4}" in a regular expression as a literal string instead of as it's documented in the manual pages. Below are some examples. The FreeBSD awk manual refers to grep to define the regular expressions it supports...
Back
Top