From 930e2f389f11aa9b2d6d9135a4575258880f0f4e Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 24 Nov 2018 19:22:04 +0100 Subject: [PATCH] v4l2-settings-restore.sh: don't use "echo -n" Dont' use "echo -n" as it's not POSIX compliant, this fixes two shellcheck warnings: In v4l2-settings-restore.sh line 27: CTRL=$(echo -n "$setting" | cut -d ' ' -f 1) ^-- SC2039: In POSIX sh, echo flags are undefined. In v4l2-settings-restore.sh line 28: VAL=$(echo -n "$setting" | cut -d ' ' -f 2) ^-- SC2039: In POSIX sh, echo flags are undefined. --- v4l2-settings-restore.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v4l2-settings-restore.sh b/v4l2-settings-restore.sh index b255da8..cb6b572 100755 --- a/v4l2-settings-restore.sh +++ b/v4l2-settings-restore.sh @@ -24,8 +24,8 @@ if [ "$ACTION" = "add" ] && [ -f "$SETTINGS_FILE" ]; then while read -r setting; do - CTRL=$(echo -n "$setting" | cut -d ' ' -f 1) - VAL=$(echo -n "$setting" | cut -d ' ' -f 2) + CTRL=$(echo "$setting" | tr -d '\n' | cut -d ' ' -f 1) + VAL=$(echo "$setting" | tr -d '\n' | cut -d ' ' -f 2) v4l2-ctl -d "$DEVNAME" --set-ctrl "${CTRL}=${VAL}" done < "$SETTINGS_FILE" fi -- 2.1.4