我想在 unix shell 中计算文档中 hard tab characters
的数量。
我该怎么做?
我试过类似的东西
grep -c\t foo
但它给出了文件 foo 中 t 的计数。
最佳答案
使用 tr 丢弃除制表符以外的所有内容,然后计数:
< input-file tr -dc \\t | wc -c
关于bash - 计算 linux 中制表符的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11035180/