by tieTYT · 11y ago · 0 comments
echo $BUNCH_OF_TEXT | awk '/amazing/ {print $1, $3}' | sed 's/amazing/mildly interesting/' sub(r, t, s)
substitutes t for the first occurrence of the regular expression r in the string s. If s is
not given, $0 is used.
gsub same as sub except that all occurrences of the regular expression are replaced; sub and gsub
return the number of replacements.
(this is awk from osx, which i think is nawk)