В man-странице iostat
написано:
The interval parameter specifies the amount of time in seconds between each
report. The first report contains statistics for the time since system
startup (boot), unless the -y option is used (in this case, this report is
omitted). Each subsequent report contains statistics collected during the
interval since the previous report.
Это значит, что первый выход iostat -dx 1
будет таким же, как iostat -dx
, но последующие выходы будут другими. - Вы не можете воспроизвести это поведение, используя Watch
.
Ваш IOSTAT -DX 1
не будет расторгнуть и непрерывно сообщать значения. ( 1
относится к интервалу до подсчета.)
Вы, вероятно, хотите что-то вроде
io_load=$(iostat -dx)
echo "$io_load"