#!/bin/bash
-# (C) 2006-2011 Andre Noll
+# Copyright (C) 2006 Andre Noll
+# Licensed under the LGPL, version 3. See COPYING and COPYING.LESSER.
_gsu_init_errors()
{
E_GSU_EDITOR failed to execute editor
E_GSU_MKDIR failed to create directory
E_GSU_GETOPTS getopts error
+E_GSU_DIALOG dialog error
+E_GSU_MKTEMP mktemp error
+E_GSU_MENU_TREE invalid menu tree
$gsu_errors
"
local a b i=0
gsu_is_a_number()
{
result="$1"
- if (("$1" == "$1")) &> /dev/null; then
+ if [ "$1" -eq "$1" ] &> /dev/null; then
ret=$GSU_SUCCESS
else
ret=-$E_GSU_NOT_A_NUMBER
gsu_msg()
{
- gsu_short_msg "$_gsu_self: $1"
+ gsu_short_msg "$gsu_name: $1"
}
gsu_date_msg()
{
- gsu_short_msg "$_gsu_self $(date): $1"
+ gsu_short_msg "$gsu_name $(date): $1"
}
gsu_err_msg()
_gsu_setup()
{
- _gsu_self="$(basename $0)"
- gsu_name="${gsu_name:=$_gsu_self}"
+ gsu_name="${gsu_name:-${0##*/}}"
gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"
gsu_banner_txt="${gsu_banner_txt:-set \$gsu_banner_txt to customize this message}"
_gsu_init_errors