我有一个设备,并且设备有很多文件,/sys/bus/iio/devices/iio:device0/
例如in_current0_raw
,,...我想在终端中定期打印它们。我尝试过的不起作用:in_current0_mean_raw
in_current0_scale
#!/bin/bash
DEVICE_PATH=/sys/bus/iio/devices/iio:device0/
CMD=$(cat ${DEVICE_PATH}in_current0_raw)
watch -n 1 printf '%-20s: %4.10f' "in_current0_raw" "cat ${DEVICE_PATH}in_current0_raw"
它打印:
%4.10f :in :cat :/sys/bus/iio/devices/iio:device0/in_current0_mean_raw: