From e79510f1639ac901f77bd3d7d4955942310b22ec Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 1 Oct 2021 11:00:50 +0200 Subject: [PATCH] zfs_count: bash lint --- zfs_count | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zfs_count b/zfs_count index 0659b83..3efe985 100644 --- a/zfs_count +++ b/zfs_count @@ -19,8 +19,8 @@ if [ "$1" = "config" ]; then # https://superuser.com/questions/284187/bash-iterating-over-lines-in-a-variable while read -r line; do # setze label .label snapshots - echo $line | awk '{print $1"_snapshot.label " $1 " snapshots"}' - echo $line | awk '{print $1"_dataset.label " $1 " datasets"}' + echo "$line" | awk '{print $1"_snapshot.label " $1 " snapshots"}' + echo "$line" | awk '{print $1"_dataset.label " $1 " datasets"}' done <<< "$list_pools" echo 'pools.label pools' # setze optionen @@ -35,11 +35,11 @@ fi # tue für jede Zeile # "echo" die Zeile, wende awk drauf, Spalte $1/$7 while read -r line; do - echo pools.value $(zpool list | sed 1d | wc -l) + echo pools.value "$(zpool list | sed 1d | wc -l)" # setze poolnamen - poolname=$(echo $line | awk '{ print $1 }') + poolname=$(echo "$line" | awk '{ print $1 }') # zähle snapshots - echo $poolname"_snapshot.value" $(zfs list -r -t snapshot $poolname| sed 1d | wc -l) - echo $poolname"_dataset.value" $(zfs list -r $poolname| sed 1d | wc -l) + echo "$poolname""_snapshot.value" "$(zfs list -r -t snapshot "$poolname" | sed 1d | wc -l)" + echo "$poolname""_dataset.value" "$(zfs list -r "$poolname" | sed 1d | wc -l)" done <<< "$list_pools" exit 0