From 435ea0ce4549dd330f291301b7ac41cac5862c5d Mon Sep 17 00:00:00 2001 From: Morgan Date: Thu, 13 Sep 2018 21:03:04 +0200 Subject: [PATCH] script: switch to multiline syntax --- top_words.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/top_words.sh b/top_words.sh index 73551f8..74d811d 100755 --- a/top_words.sh +++ b/top_words.sh @@ -7,7 +7,18 @@ url="${1:-}" basedir=$(dirname "$0") if [[ "${url:-}" = "" ]]; then - grep --only-matching --extended-regexp '[a-zA-Z]{3,}' "$basedir/README.md" | tr '[:upper:]' '[:lower:]' | grep --invert-match --word-regexp --fixed-strings --file=stopwords.txt | sort | uniq --count | sort -n + grep --only-matching --extended-regexp '[a-zA-Z]{3,}' "$basedir/README.md" \ + | tr '[:upper:]' '[:lower:]' \ + | grep --invert-match --word-regexp --fixed-strings --file=stopwords.txt \ + | sort \ + | uniq --count \ + | sort -n else - curl "$url" | grep --only-matching --extended-regexp '[a-zA-Z]{3,}' | tr '[:upper:]' '[:lower:]' | grep --invert-match --word-regexp --fixed-strings --file=stopwords.txt | sort | uniq --count | sort -n + curl "$url" \ + | grep --only-matching --extended-regexp '[a-zA-Z]{3,}' \ + | tr '[:upper:]' '[:lower:]' \ + | grep --invert-match --word-regexp --fixed-strings --file=stopwords.txt \ + | sort \ + | uniq --count \ + | sort -n fi