我想生成一个包含所有 8 位数字的排序列表——从 00000000 到 99999999。我在 shell 中输入:
f() {
while IFS="" read -r line; do
for i in {0..9}; do
echo "$line$i";
done;
done
}
echo | f | f | f | f | f | f | f | f | tee result.txt | wc -l
Run Code Online (Sandbox Code Playgroud)
回应是
bash: echo: write error: Interrupted system call
bash: echo: write error: Interrupted system call
bash: echo: write error: Interrupted system call
99998890
Run Code Online (Sandbox Code Playgroud)
为什么我会收到这三个错误和格式错误的 result.txt ?
我用
GNU bash,版本 4.4.12(1)-release (x86_64-pc-linux-gnu) …
在 GNU/Linux 系统上,我只看到了正 PID,但是当发生内核恐慌时,我看到了有关 PID=0 的进程的信息。那是什么?
在 Minix 3 上我见过带有负 PID 的进程。Minix 是 POSIX 兼容系统,但POSIX 只允许正 PID。它是什么?
我应该在 C 中使用什么变量类型来保存进程 ID?