]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - funcs/gsu
gsu: Replace "$*" by "$@".
[gsu.git] / funcs / gsu
index 221aad6c332ff4c370cd0c1500f3c44503af990e..136eda645e86fe39ebb6d8ea863f09487ce3fb79 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -17,7 +17,7 @@ $gsu_errors
                #echo "a:$a,  b: $b"
                gsu_error_txt[i]="$b"
                eval $a=$i
-               i=$((i + 1))
+               i=$(($i + 1))
        done << EOF
        $gsu_errors
 EOF
@@ -85,7 +85,7 @@ gsu_err_msg()
        else
                txt="${gsu_error_txt[$err]}"
        fi
-        echo "$gsu_self: $txt" 1>&2
+       gsu_msg "$txt"
 }
 export -f gsu_err_msg
 
@@ -161,8 +161,8 @@ gsu_print_available_commands()
        gsu_short_msg "Available commands:"
        for i in $gsu_cmds; do
                printf "$i"
-               count=$((count + 1))
-               if test $((count % 4)) -eq 0; then
+               count=$(($count + 1))
+               if test $(($count % 4)) -eq 0; then
                        echo
                else
                        printf "\t"
@@ -178,6 +178,8 @@ export -f gsu_print_available_commands
 
 gsu()
 {
+       local i
+
        gsu_self="$(basename $0)"
        gsu_init_errors
        gsu_available_commands
@@ -191,7 +193,8 @@ gsu()
        shift
        for i in $gsu_cmds; do
                if test "$arg" = "$i"; then
-                       com_$arg $*
+                       com_$arg "$@"
+                       ret=1
                        if test $ret -lt 0; then
                                gsu_err_msg
                                exit 1