diff options
author | наб <[email protected]> | 2021-05-21 23:43:38 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-06-01 11:38:49 -0700 |
commit | c3ef9f7528d160faa08bbddfa29d7ad58835e1bd (patch) | |
tree | 92908b88b6e62697da5156129e2fe4b929411e64 /cmd/zpool/zpool.d | |
parent | d3858ab78894cbd6d2b63d350a25dfa7ab378ce7 (diff) |
Turn shellcheck into a normal make target. Fix new files it caught
This checks every file it checked (and a few more),
but explicitly instead of "if it works it works" best-effort
(which wasn't that good anyway)
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #10512
Closes #12101
Diffstat (limited to 'cmd/zpool/zpool.d')
-rwxr-xr-x | cmd/zpool/zpool.d/smart | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/zpool/zpool.d/smart b/cmd/zpool/zpool.d/smart index f8854b752..b71591abb 100755 --- a/cmd/zpool/zpool.d/smart +++ b/cmd/zpool/zpool.d/smart @@ -53,7 +53,7 @@ get_filename_from_dir() num_files=$(find "$dir" -maxdepth 1 -type f | wc -l) mod=$((pid % num_files)) i=0 - find "$dir" -type f -printf "%f\n" | while read -r file ; do + find "$dir" -type f -printf '%f\n' | while read -r file ; do if [ "$mod" = "$i" ] ; then echo "$file" break @@ -231,11 +231,11 @@ esac with_vals=$(echo "$out" | grep -E "$scripts") if [ -n "$with_vals" ]; then echo "$with_vals" - without_vals=$(echo "$scripts" | tr "|" "\n" | + without_vals=$(echo "$scripts" | tr '|' '\n' | grep -v -E "$(echo "$with_vals" | awk -F "=" '{print $1}')" | awk '{print $0"="}') else - without_vals=$(echo "$scripts" | tr "|" "\n" | awk '{print $0"="}') + without_vals=$(echo "$scripts" | tr '|' '\n' | awk '{print $0"="}') fi if [ -n "$without_vals" ]; then |