我想生成一个包含所有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
回应是
bash: echo: write error: Interrupted system call
bash: echo: write error: Interrupted system call
bash: echo: write error: Interrupted system call
99998890
为什么会出现这三个错误并且格式错误的result.txt?
我用
GNU bash版本4.4.12(1)-发行版(x86_64-pc-linux-gnu)
Debian GNU / Linux 9.6(延伸)
Linux内核:4.19.0#2 SMP Thu Nov 1 15:31:34 EET 2018 x86_64 GNU / Linux
})正常工作。@ GAD3R
konsole窗口大小时出现。在我看来,这种调整大小几乎是足够的,但不是必需的。
| tee result.txt,但仍然会收到错误消息。
/bin/echo在我的情况下)而不是echo内置文件,使该函数不受此问题的影响(或至少较不容易受到影响)。
seq -w 0 99999999。