Awk does not compare numbers correct.
Input data:
Output (Expected):
Actual Output:
Input data:
Code:
Filesystem Type 1048576-blocks Used Available Capacity Mounted on
udev devtmpfs 7933 0 7933 0% /dev
tmpfs tmpfs 1598 10 1589 1% /run
rpool/ROOT/pve-1 zfs 322247 2910 319337 1% /
tmpfs tmpfs 7989 60 7929 1% /dev/shm
tmpfs tmpfs 5 0 5 0% /run/lock
tmpfs tmpfs 7989 0 7989 0% /sys/fs/cgroup
rpool zfs 319337 1 319337 1% /rpool
rpool/data zfs 319337 1 319337 1% /rpool/data
rpool/ROOT zfs 319337 1 319337 1% /rpool/ROOT
rpool/data/subvol-110-disk-1 zfs 2048 235 1814 12% /rpool/data/subvol-110-disk-1
rpool/data/subvol-101-disk-3 zfs 1024 3 1022 1% /rpool/data/subvol-101-disk-3
rpool/data/subvol-101-disk-2 zfs 36864 26065 10800 71% /rpool/data/subvol-101-disk-2
rpool/data/subvol-100-disk-0 zfs 8192 1322 6871 17% /rpool/data/subvol-100-disk-0
rpool/data/subvol-104-disk-0 zfs 8192 916 7276 12% /rpool/data/subvol-104-disk-0
rpool/data/subvol-111-disk-0 zfs 8192 1025 7168 13% /rpool/data/subvol-111-disk-0
rpool/data/subvol-128-disk-0 zfs 8192 599 7593 8% /rpool/data/subvol-128-disk-0
rpool/data/subvol-114-disk-0 zfs 322444 3108 319337 1% /rpool/data/subvol-114-disk-0
rpool/data/subvol-110-disk-3 zfs 36864 19935 16930 55% /rpool/data/subvol-110-disk-3
rpool/data/subvol-110-disk-0 zfs 8192 3648 4545 45% /rpool/data/subvol-110-disk-0
rpool/data/subvol-106-disk-0 zfs 8192 599 7594 8% /rpool/data/subvol-106-disk-0
rpool/data/subvol-108-disk-0 zfs 8192 642 7551 8% /rpool/data/subvol-108-disk-0
rpool/data/subvol-117-disk-0 zfs 8192 862 7331 11% /rpool/data/subvol-117-disk-0
rpool/data/subvol-113-disk-0 zfs 8192 590 7603 8% /rpool/data/subvol-113-disk-0
rpool/data/subvol-119-disk-0 zfs 8192 624 7569 8% /rpool/data/subvol-119-disk-0
rpool/data/subvol-101-disk-0 zfs 8192 67 8126 1% /rpool/data/subvol-101-disk-0
rpool/data/subvol-105-disk-0 zfs 8192 1101 7092 14% /rpool/data/subvol-105-disk-0
bpool zfs 460015 161532 298483 36% /bpool
rpool/data/subvol-110-disk-4 zfs 4096 414 3683 11% /rpool/data/subvol-110-disk-4
rpool/data/subvol-114-disk-1 zfs 32768 50 32719 1% /rpool/data/subvol-114-disk-1
rpool/data/subvol-101-disk-1 zfs 83968 66216 17752 79% /rpool/data/subvol-101-disk-1
rpool/data/subvol-116-disk-0 zfs 8192 831 7362 11% /rpool/data/subvol-116-disk-0
rpool/data/subvol-102-disk-1 zfs 8192 620 7573 8% /rpool/data/subvol-102-disk-1
/dev/fuse fuse 30 1 30 1% /etc/pve
nfs.mufi:/var/nfs/proxmox nfs4 36864 26064 10800 71% /mnt/pve/remote-nfs.mufi-nfs
tmpfs tmpfs 1598 0 1598 0% /run/user/0
Bash:
df -TmP|awk -v x=70 '/\/$|subvol/ {if ( $6 >= x) print $6}'
Output (Expected):
Code:
71%
79%
Actual Output:
Code:
71%
8%
8%
8%
8%
8%
79%
8%
Last edited: