Bash functional

From wikinotes
Revision as of 15:08, 10 February 2021 by Will (talk | contribs) (Created page with "= Filter = <blockquote> <source lang="bash"> # filters out results not matching 'grep foo' find . \ | while read line; do \ echo $line | grep foo && echo "$line"; \ do...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Filter

# filters out results not matching 'grep foo'
find . \
  | while read line; do \
    echo $line | grep foo && echo "$line"; \
  done

Map

Reduce