tr命令中-C和-c的区别是什么?

时间:2017-06-03 20:45:02

标签: macos tr bsd

从手册页......

-C  Complement the set of characters in
    string1, that is ``-C ab'' includes
    every character except for `a' and `b'.

-c  Same as -C but complement the set of
    values in string1.

不确定set of charactersset of values之间是否存在差异,但这两个选项似乎都提供相同的输出......

$ echo abc123 | tr -Cd [:digit:]  # 123
$ echo abc123 | tr -cd [:digit:]  # 123

我在macOS 10.12.4上运行它

0 个答案:

没有答案
相关问题