[pisa-src] r932 - trunk/tools

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 04 Sep 2009 15:47:00 +0200

Author: biurrun
Date: Fri Sep  4 15:47:00 2009
New Revision: 932

Log:
Fix bashism: Parameter expansion expressions with "${CMD:1}" are not
POSIX-compatible. Use an equivalent portable expression instead.

Modified:
   trunk/tools/switch-ip
   trunk/tools/switch-ip.bareasus
   trunk/tools/switch-ip.owrtasus

Modified: trunk/tools/switch-ip
==============================================================================
--- trunk/tools/switch-ip       Fri Sep  4 15:33:52 2009        (r931)
+++ trunk/tools/switch-ip       Fri Sep  4 15:47:00 2009        (r932)
@@ -113,7 +113,7 @@
        shift 1
 fi
 
-if [ "${CMD:0:1}" = "-" ]; then
+if [ ! "${CMD#-}" = "${CMD}" ]; then
        CMD="ifconfig"  # choose the default command
        echo "choosing default command ifconfig!"
 else

Modified: trunk/tools/switch-ip.bareasus
==============================================================================
--- trunk/tools/switch-ip.bareasus      Fri Sep  4 15:33:52 2009        (r931)
+++ trunk/tools/switch-ip.bareasus      Fri Sep  4 15:47:00 2009        (r932)
@@ -113,7 +113,7 @@
        shift 1
 fi
 
-if [ "${CMD:0:1}" = "-" ]; then
+if [ ! "${CMD#-}" = "${CMD}" ]; then
        CMD="ifconfig"  # choose the default command
        echo "choosing default command ifconfig!"
 else

Modified: trunk/tools/switch-ip.owrtasus
==============================================================================
--- trunk/tools/switch-ip.owrtasus      Fri Sep  4 15:33:52 2009        (r931)
+++ trunk/tools/switch-ip.owrtasus      Fri Sep  4 15:47:00 2009        (r932)
@@ -113,7 +113,7 @@
        shift 1
 fi
 
-if [ "${CMD:0:1}" = "-" ]; then
+if [ ! "${CMD#-}" = "${CMD}" ]; then
        CMD="ifconfig"  # choose the default command
        echo "choosing default command ifconfig!"
 else

Other related posts:

  • » [pisa-src] r932 - trunk/tools - Diego Biurrun