v4l2-settings-restore.sh: don't use "echo -n"
[v4l2-persistent-settings.git] / v4l2-settings-restore.sh
index b255da8..cb6b572 100755 (executable)
@@ -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