Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 cshell 中计算一行中的单词数。单词由一个空格或多个空格分隔。例如,
fish duck cheese bacon
将返回 4。我缺少一个简单的命令吗?
尝试
$ echo "fish duck cheese bacon" | wc -w