作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是 MAC 中的 shell,
为什么字数 (wc) 显示错误的字符数?
sh-3.2# /Users/orly/Desktop/random.password.py 1
5
sh-3.2# /Users/orly/Desktop/random.password.py 1 | wc -m
2
sh-3.2#
最佳答案
您的文件中可能有换行符。这将解释字符数为 2。
附录:试试这个:
hexdump -C
$ echo "dog" | wc -m
4
$ echo "dog" | hexdump -C
00000000 64 6f 67 0a |dog.|
00000004
关于shell - shell 中奇怪的厕所行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6798407/
我已经在 Stackoverflow 上阅读了有关此主题的帖子,但无法理解要点。也许我们可以将它们的差异限制在一个具体的例子中。 有一个带锁的厕所。Mutex:一个线程拿走 key 进去。如果有任何其
抱歉,如果我的问题不清楚,我的词汇量在 c 和指针等方面不是很好。 我有一个简单的程序,它采用包含以下结构的 header data.h。 #ifndef MENU_H_ #define MENU_H
当我在终端中运行此命令时,它会显示一个数字。当我使用 cd 命令挂载另一个文件夹时,数字会发生变化。 最佳答案 ls -la // List files in your current directo
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 已关闭 5 年前。 此问题似乎与 a specific programming problem, a sof
我知道这是一个简单的练习,但我遇到了麻烦。我正在尝试模仿: grep arg1 arg2 | wc -l 我收到以下错误:“wc:标准输入:执行时文件描述符错误”。这是我的代码: int main(i
我是一名优秀的程序员,十分优秀!