使用现有 PID 的 pv 不适用于 -s 选项

使用现有 PID 的 pv 不适用于 -s 选项

我想在通话时同时使用-d和选项。我尝试如下:-spv

 $ cat -n /tmp/x.py
     1  import time
     2  import threading
     3  import sys
     4
     5  def w():
     6      for _ in range(100):
     7          with open('/tmp/x.txt', 'a') as f:
     8              f.write('hello, world!\n')
     9              time.sleep(0.3)
    10
    11  for _ in range(10):
    12      threading.Thread(target=w).start()
 $ python /tmp/x.py & pv -d $! -ptebar -s 14k
[1] 8241
   3:/tmp/x.txt: 2,09KiB 0:00:04 [ 390 B/s] [ 456 B/s] [      <=>  ]
   4:/tmp/x.txt: 2,12KiB 0:00:04 [ 404 B/s] [ 446 B/s] [      <=>  ]
   5:/tmp/x.txt: 2,08KiB 0:00:04 [ 362 B/s] [ 449 B/s] [      <=>  ]
   6:/tmp/x.txt: 2,15KiB 0:00:04 [ 432 B/s] [ 453 B/s] [      <=>  ]
   7:/tmp/x.txt: 2,15KiB 0:00:04 [ 376 B/s] [ 453 B/s] [      <=>  ]
   8:/tmp/x.txt: 2,06KiB 0:00:04 [ 418 B/s] [ 432 B/s] [      <=>  ]
   9:/tmp/x.txt: 2,19KiB 0:00:04 [ 418 B/s] [ 481 B/s] [      <=>  ]
  10:/tmp/x.txt: 2,19KiB 0:00:04 [ 460 B/s] [ 460 B/s] [      <=>  ]
  11:/tmp/x.txt: 2,17KiB 0:00:04 [ 404 B/s] [ 453 B/s] [      <=>  ]
  12:/tmp/x.txt: 2,16KiB 0:00:04 [ 390 B/s] [ 446 B/s] [      <=>  ]

-s参数似乎被忽略。有没有办法让进度和eta实际可见?另外,正如我在消息中读到的那样,不可能有-lwith-d选项,但对我来说它更方便。你知道该怎么做吗?有没有办法不在此列表中重复相同的文件?

相关内容