diff options
| author | verdant <im@verdant.ee> | 2026-06-02 17:50:25 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-06-02 17:50:25 +0800 |
| commit | 2ebfeccb3d2b99c69a77174895a606091ff4d5c0 (patch) | |
| tree | ff93b6e0418c3c60c7b1ae0d331fd9682c9c6b21 /scripts | |
| parent | fa35a9cc023b5a72adb1e83a50e2b3df37cfcb82 (diff) | |
| download | blog-2ebfeccb3d2b99c69a77174895a606091ff4d5c0.tar.gz blog-2ebfeccb3d2b99c69a77174895a606091ff4d5c0.zip | |
Add word count scipt
no arg: just show the word count
-s: count and show in descending order
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/word_count.sh | 12 | ||||
| -rwxr-xr-x | scripts/word_count.sh~ | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/scripts/word_count.sh b/scripts/word_count.sh new file mode 100755 index 0000000..78e11c8 --- /dev/null +++ b/scripts/word_count.sh @@ -0,0 +1,12 @@ +#!/bin/bash + + + +if ["$1" = "-s"]; then + wc -m *.md | sort -rn +fi + +if ["$1" = ""]; then + ls -l | awk '{print $9}' | xargs cat | LANG=C.UTF-8 wc -m +fi + diff --git a/scripts/word_count.sh~ b/scripts/word_count.sh~ new file mode 100755 index 0000000..d37642d --- /dev/null +++ b/scripts/word_count.sh~ @@ -0,0 +1,5 @@ +#!/bin/bash + +if ["$1" = ] + +wc -m *.md | sort -rn |
