我想生成一个包含所有 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) …
bash ×1