Suppose I have a couple of line formats:
this:foo ...
that: foo ...
And I want to run two different routines for one form or the other:
cat text_file \
| awk -F ':' '/:foo/ { # do this } # else print the whole line unchanged'
| awk -F ':' '/ +foo +/ { # do that } # else print the whole line unchanged'
Ideally, I could write:
cat text_file \
| awk -F ':' '
/:foo/ { ... }
/ +foo +/ { ... }
...
/.*/ { print }
'
But things seem to be behaving a lot differently than I expect. Is there a particular way to do this?