2485 shaares
83 private links
83 private links
Instead of using sed ''command "file" | awk 'operation' you can just do it all with awk alone and avoid pipelines (|) ... awk 'command' "infile" >> "outfile"
You can pattern match with awk just like you are with sed... awk '!/^#/ {print}' .. this // acts as a pattern match of the current line just like sed, the ! just negates it, you can also chain them together with && and || .. awk '!/^#/ && !/^$/ {print}' prints all lines except commented and blank ones.