About 1,290,000 results
Open links in new tab
  1. AWK: Access captured group from line pattern - Stack Overflow

    Jun 29, 2018 · If I have an awk command pattern { ... } and pattern uses a capturing group, how can I access the string so captured in the block?

  2. What are NR and FNR and what does "NR==FNR" imply?

    In Awk: FNR refers to the record number (typically the line number) in the current file. NR refers to the total record number. The operator == is a comparison operator, which returns true when …

  3. linux - using awk with column value conditions - Stack Overflow

    I'm learning awk from The AWK Programming Language and I have a problem with one of the examples. If I wanted to print $3 if $2 is equal to a value (e.g.1), I was using this command …

  4. sed - How to use awk to print lines where a field matches a …

    I have: 1 LINUX param1 value1 2 LINUXparam2 value2 3 SOLARIS param3 value3 4 SOLARIS param4 value4 I need awk to print all lines in which $2 is LINUX.

  5. find a string in a string using awk - Stack Overflow

    here is column 6 in a file: ttttttttttt tttttttttt ttttttttt tttttttattt tttttttttt ttttttttttt how can I use awk to print out lines that include "a"

  6. bash - Can I use awk within awk in UNIX? - Stack Overflow

    BTW the short answer is yes, you could use system() to run an AWK command within an AWK script, or since you tagged bash, maybe you're trying to embed the output of one AWK …

  7. Print the last line of a file, from the CLI - Stack Overflow

    Jun 20, 2010 · This answer pipes the entire contents of the file to awk for filtering out everything but the last line. The other answer of tail -n 1 file makes more sense.

  8. How can I pass variables from awk to a shell command?

    Dec 18, 2013 · I am trying to run a shell command from within awk for each line of a file, and the shell command needs one input argument. I tried to use system (), but it didn't recognize the …

  9. cut or awk command to print first field of first row

    Mar 5, 2014 · awk '{ print; exit }' … in a slightly less verbose manner. For a single line print, it's not even worth it to set FS to skip the field splitting part. using that concept to print just 1st row 1st …

  10. How to print matched regex pattern using awk? - Stack Overflow

    Apr 4, 2011 · Using awk, I need to find a word in a file that matches a regex pattern. I only want to print the word matched with the pattern. So if in the line, I have: xxx yyy zzz And pattern: /yyy/ …