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.
then
while read -r setting;
do
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
v4l2-ctl -d "$DEVNAME" --set-ctrl "${CTRL}=${VAL}"
done < "$SETTINGS_FILE"
fi