handle URLs

This commit is contained in:
Morgan 2018-09-13 20:58:56 +02:00
parent d8f5f6f926
commit fc5825abba
2 changed files with 5642 additions and 3 deletions

5629
blabla.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,13 @@
#/usr/bin/env bash #!/usr/bin/env bash
BASEDIR=$(dirname "$0") set -o errexit
grep -o -E '[a-zA-Z]{3,}' "$BASEDIR/README.md" | tr A-Z a-z | grep -vwFf stopwords.txt | sort | uniq -c | sort -n set -o nounset
set -o pipefail
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
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
fi