note
2017年4月18日 星期二
[SHELL] 統計檔案中多個字串的方法
# my shell is zsh
declare -a arr; arr=("str1" "str2" "str3")
echo -----------------------------
for i in "${arr[@]}"
do
echo -n "$i:\t"
grep $i file.txt | wc -l
done
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言