Skip to contentSkip to conversation

gmsl-yavta: Remove bash-isms

PATCH Applied Laurent Pinchart 2 participants 2 messages Jan 31, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gmsl-yavta: Remove bash-isms

The script contains two bash-specific constructs:

- Replace ${!var} expansion with eval
- Initialize conf1234 and conf5678 variables to avoid empty argument to -ne test

---
 gmsl-yavta.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
gmsl-yavta.sh +5 -1
index 635ab72feb07..a123bf52a16d 100755
@@ -22,13 +22,17 @@ function conf() {
 
 function capture() {
     VID="$1"
+    vid=$(eval echo \$$VID)
 
-    yavta -f YUYV -s 1280x800 -c10 --skip 7 --file="$out/$VID-#.bin" /dev/${!VID} &
+    yavta -f YUYV -s 1280x800 -c10 --skip 7 --file="$out/$VID-#.bin" /dev/$vid &
 }
 
 mc_reset
 
 # Need to configure all formats going through each MAX9286
+conf1234=0
+conf5678=0
+
 for cam in "$@"; do
 	case $cam in
         1|2|3|4)
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

Hi Laurent,

Thanks for your patch.

Quoted 7 lines · Laurent Pinchart

The script contains two bash-specific constructs:

- Replace ${!var} expansion with eval
- Initialize conf1234 and conf5678 variables to avoid empty argument to -ne test

Applied.

Quoted 32 lines
---
 gmsl-yavta.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
gmsl-yavta.sh +5 -1
index 635ab72feb07..a123bf52a16d 100755
@@ -22,13 +22,17 @@ function conf() {
 
 function capture() {
     VID="$1"
+    vid=$(eval echo \$$VID)
 
-    yavta -f YUYV -s 1280x800 -c10 --skip 7 --file="$out/$VID-#.bin" /dev/${!VID} &
+    yavta -f YUYV -s 1280x800 -c10 --skip 7 --file="$out/$VID-#.bin" /dev/$vid &
 }
 
 mc_reset
 
 # Need to configure all formats going through each MAX9286
+conf1234=0
+conf5678=0
+
 for cam in "$@"; do
 	case $cam in
         1|2|3|4)
Signature · 3 lines
Regards,

Laurent Pinchart
Signature · 2 lines
Regards,
Niklas S�derlund