New answers tagged

3

The standard (POSIX) sh syntax which should work in any conformant implementation including recent versions of dash would be: #!/bin/sh - reg=0x000000 done=0x4A9FFF while [ "$((reg))" -le "$((done))" ]; do reg=$((reg + 1)) printf 'wm8280_reg get 0x%06X\r\n' "$reg" sleep 1 done If you need to be portable to versions of dash prior to 0.5.5 (2009), ...


0

Right, Thank you all for your input. The final script looks like: #!/bin/sh export REG=0 export DONE=4890632 while [ "$((REG))" -le "$((DONE))" ] do wm8280_reg get $REG >> "wm_reg_dump.txt" REG=$(($((REG))+1)) done This runs in DASH and has the required output. Sure, the code takes 8 hours to run, but hey, set it and forget it :)


1

The example #!/bin/sh export $REG=0x000000 export $DONE=0x4A9FFF while $REG -le $DONE do (($REG+1)) printf 'wm8280_reg get 0x'$REG'\r\n' sleep 1 done should change: the two lines with export should not have $ prefixing the variables use [ and ] around the $REG -le $DONE expression (or use test before) quote variables when they ...


0

Found the solution, here is one example finding the ID of a miniportal window already present in case you can to move a portal window back to miniportal and hence switch the miniportal window to portal. function getportalwindowID { IFS=$'\n' W=5 H=6 X=3 Y=4 ID=1 windowsID=($(wmctrl -l -G | awk -v ID=$ID '{print $ID}')) windowsgeometry_w=($(wmctrl -l -G | ...



Top 50 recent answers are included