-#!/bin/bash
# gsu -- the global subcommand utility
# (C) 2006-2007 Andre Noll
E_GSU_NOT_A_NUMBER not a number
$gsu_errors
"
- local a b i
- local i=0
+ local a b i=0
while read a b; do
if test -z "$a"; then
continue
#echo "a:$a, b: $b"
gsu_error_txt[i]="$b"
eval $a=$i
- i=$((i + 1))
+ i=$(($i + 1))
done << EOF
$gsu_errors
EOF
| sed -e 's/^com_\([a-zA-Z_0-9]\+\)()#*/\1\t/' \
| sort \
| while read a b; do
- echo -en "$a\t"
- if test ${#a} -lt 8; then
- echo -en "\t"
- fi
- echo "$b"
+ printf "$a\t"
+ if test ${#a} -lt 8; then
+ printf "\t"
+ fi
+ echo "$b"
done
echo
- gsu_msg "Try $0 help <command> for info on <command>."
+ gsu_msg "Try $gsu_self help <command> for info on <command>."
ret=$GSU_SUCCESS
return
fi
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"