On 1/31/11 12:31 AM, Bastian Bittorf wrote:
+dialog() {
+       local tag="$(echo "$1" | cut -d= -f1)"
+       local value="$(echo "$1" | cut -d= -f2-)"

i think the trailing '-' is an mistake...

No, it means "from 2 to the end".  In other words, I never want the string into 
more than 2 substrings... if it contains 2 or more delimiters, then they will all be 
together, unsplit, as the 2nd substring:

% echo "a:b:c:d:e" | cut -d: -f2-
b:c:d:e
%


+      response="$(soloscli -s "$port" "$tag" "$value")"
+       [ $? -ne 0 ]&&  {
+               logger "soloscli($port): $tag '$value' returns $response"

you can also write:

var="$( false )" || {
      logger ...
}


bye, Bastian.

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to