DPV(1) | MidnightBSD General Commands Manual | DPV(1) |
dpv
— stream data
from stdin or multiple paths with dialog progress view
dpv |
[options]
[bytes: ]label |
dpv |
[options] -m
[bytes1 ]:label1
path1
[[bytes2: ]label2
path2 ...] |
dpv
provides a dialog progress view,
allowing a user to see current throughput rate and total data transferred
for one or more streams.
The dpv
utility has two main modes for
processing input.
The default input mode, without
‘
’,
-m
dpv
reads bytes from standard input. A label for the
data must be provided.
The secondary input mode, with
‘
’,
-m
dpv
reads multiple paths (up to 2047 or
“ARG_MAX/2-1”), sequentially.
Data read in either mode is either thrown away (default), sent to
a spawned instance of the program specified via
‘
’, or sent to a unique file specified
by ‘-x
cmd
’.-o
file
With or without
‘
’, progress
is displayed using one of
dialog(3) (default),
dialog(1) (see
‘-m
’), or
instead Xdialog(1) (see
‘-D
’).-X
The following options are available:
-a
text-b
backtitle-D
DIALOG
environment variable or simply
“dialog
” if unset or NULL.-d
-h
-I
format-D
’ or
‘-X
’ which
lack the ability to display the status line (containing bytes/rate/thread
information). Default value is “%'10lli bytes read
@ %'9.1f bytes/sec. [%i/%i busy/wait]
”. This format is used
when handling more than one file.-i
format-D
’ or
‘-X
’ which
lack the ability to display the status line (containing bytes/rate/thread
information). Default value is “%'10lli bytes read
@ %'9.1f bytes/sec.
”. This format is used when handling one
file.-k
-L
size-l
-m
-N
-n
num-o
file%s
’ (if any) in
‘file
’ will be
replaced with the label text.-P
size-p
text-T
[TEST MODE]
” to
the status line (to override, use
‘-u
format
’). No data is actually
read.-t
title-X
’ and
‘-b
backtitle
’, the
backtitle and title are
effectively switched (see BUGS section below).-U
num2
’. A value
of ‘0
’
disables status line updates. If negative, update the status line as fast
as possible. Ignored when using either
‘-D
’ or
‘-X
’ which
lack the ability to display the status line (containing bytes/rate/thread
information).-w
-p
’ and
‘-a
’ to bump
the dialog width. Prompts wider than the maximum width will wrap (unless
using Xdialog(1); see
BUGS section below).-X
-x
cmd-m
’,
cmd is executed once for each
path argument. The first occurrence of
‘%s
’ (if any) in
‘cmd
’ will be
replaced with the label text.The following environment variables are referenced by
dpv
:
DIALOG
-D
’) or
Xdialog(1) (requires
‘-X
’);
default is either ‘dialog
’ (for
‘-D
’) or
‘Xdialog
’ (for
‘-X
’).DIALOGRC
.dialogrc
’ file.HOME
$DIALOGRC
’
is either not set or NULL, used as a prefix to
‘.dialogrc
’ (i.e.,
‘$HOME/.dialogrc
’).USE_COLOR
If using
‘
’,
dialog(1) is
required.-D
If using
‘
’,
Xdialog(1) is
required.-X
Simple example to show how fast yes(1) produces lines (usually about ten-million per-second; your results may vary):
yes | dpv -l yes
Display progress while timing how long it takes yes(1) to produce a half-billion lines (usually under one minute; your results may vary):
time yes | dpv -Nl 500000000:yes
An example to watch how quickly a file is transferred using nc(1):
dpv -x "nc -w 1 somewhere.com 3000" -m label file
A similar example, transferring a file from another process and
passing the expected size to dpv
:
cat file | dpv -x "nc -w 1 somewhere.com 3000" 12345:label
A more complicated example:
tar cf - . | dpv -x "gzip -9 > out.tgz" \ $( du -s . | awk '{print $1 * 1024}' ):label
Taking an image of a disk:
dpv -o disk-image.img -m label /dev/ada0
Writing an image back to a disk:
dpv -o /dev/ada0 -m label disk-image.img
Zeroing a disk:
dpv -o /dev/md42 "Zeroing md42" < /dev/zero
A dpv
utility first appeared in
FreeBSD 10.2.
Devin Teske ⟨dteske@FreeBSD.org⟩
Xdialog(1),
when given both ‘
’ (see above
‘--title
title
’) and
‘-t
title
’ (see above
‘--backtitle
backtitle
’), displays the backtitle in
place of the title and vice-versa.-b
backtitle
Xdialog(1)
does not wrap long prompt texts received after initial launch. This is a
known issue with the ‘--gauge
’ widget
in Xdialog(1).
dialog(1) does not display the first character after a series of escaped escape-sequences (e.g., ``\\n'' produces ``\'' instead of ``\n''). This is a known issue with dialog(1) and does not affect dialog(3) or Xdialog(1).
If your application ignores USE_COLOR
when
set and NULL before calling
dpv(1) with color escape
sequences anyway,
dialog(3) and
dialog(1) may not render
properly. Workaround is to detect when USE_COLOR
is
set and NULL and either not use color escape sequences at that time or use
unset(1)
[sh(1)] or
unsetenv(1)
[csh(1)] to unset
USE_COLOR
, forcing interpretation of color
sequences. This does not effect
Xdialog(1), which
renders the color escape sequences as plain text. See “embedded
"\Z" sequences” in
dialog(1) for additional
information.
November 2, 2021 | midnightbsd-3.1 |