如何使用 Unix shell 脚本计算文件名中“_"的出现次数 [英] How do I count the number of occurance of '_' in my file name using Unix shell script
本文介绍了如何使用 Unix shell 脚本计算文件名中“_"的出现次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想计算我的文件名中出现_"(低于分数)的次数.我该怎么做?
I would like to count the number of time '_' (under score) is appearing in my file name. How do I do that?
推荐答案
echo $filename | tr -c -d _ | wc -c
这篇关于如何使用 Unix shell 脚本计算文件名中“_"的出现次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文