小编opt*_*ian的帖子

Linux"echo -n"没有被刷新

我有以下代码:

while ...
  echo -n "some text"
done | while read; do
  echo "$REPLY" >> file
done
Run Code Online (Sandbox Code Playgroud)

但echo只在没有"-n"标志的情况下使用.看起来像使用-n时,输出不会被下一个while循环刷新/读取

即使未遵循EOL,我怎样才能确保读取"某些文本"?

linux bash

9
推荐指数
1
解决办法
297
查看次数

标签 统计

bash ×1

linux ×1