* Nathan Hintz <[email protected]> [19.10.2014 08:49]: > > case "$leddc" in > > '0xffff'*) > > leddc='0x005a000a' > > ;; > > esac > > > > IMHO the approach from felix does not work: > > root@box:~ echo $((0xffff)) > > 65535 > > root@box:~ echo $((0xffff\n)) > > -ash: arithmetic syntax error > > > > the real would be the fix the output of 'wlc'. > > 'wlc' is not broken, a simple test case demonstrates it works as expected: > > root@e3000-1:~# wlc ifname wl0 leddc > 0x005a000a > root@e3000-1:~# wlc ifname wl0 leddc 0xffff > root@e3000-1:~# wlc ifname wl0 leddc > 0xffff > root@e3000-1:~# leddc=$(wlc ifname wl0 leddc) > root@e3000-1:~# [ "$leddc" = "0xffff" ] && echo yes > yes > root@e3000-1:~# wlc ifname wl0 leddc 0x005a000a > root@e3000-1:~# wlc ifname wl0 leddc > 0x005a000a > root@e3000-1:~# leddc=$(wlc ifname wl0 leddc) > root@e3000-1:~# [ "$leddc" = "0xffff" ] && echo yes > root@e3000-1:~#
ah - ok. sorry felix - i really was thinking that it outputs a string '0xffff\n' (with the symbol of a newline). so your approach is correct but without quotes, so: [ $((leddc)) -eq $((0xffff)) ] && ... bye, bastian - please Álvaro send a new patch _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
