Does anyone have a solution for that problem:

ModManager() {
 ClearFiles -4
echo "zenity --list --window-icon=\"${run_path}icon.png\" --width=\"650\" --height=\"350\" --title=\"${modmanager[${lang}]}\" --text=\"${RegMods[${lang}]}:\" --column=\"${no[${lang}]}\" --column=\"${name_loc[${lang}]}\" --column=\"Modus\" \\" >&4
 for (( a = 1; a <= MODULES; a++ ))
 do
   echo "${a} \"${mod[${a}]} in ${loc[${a}]}\" ${mode[${a}]} \\" >&4
 done
 echo "__ ___________________ __ \\" >&4
 echo "add \"${add_mod[${lang}]}\" __ \\" >&4
 echo "del \"${del_mod[${lang}]}\" __ \\" >&4
 echo "back \"${back[${lang}]}\" __" >&4
 command=`. ${tmpmenu}`
 case ${command} in
   "add") AddModule ;;
   "del") DelModule ;;
   *) Main ;;
 esac
}

This function allows the user to manage the modules that are registered in the scripts configuration files. First it "build" a zenity command. This is necessary because of the for statement. That provide the information about the modules. All lines are send to the file descriptor 4. Before, to do not annoy the script, the file behind descriptor 4 is cleared with the function ClearFiles. Finally the command is executed and the result is compared. If I want to use the ModManager function, all I get is nothing. It just do a break.

Here you have the function ClearFiles:
ClearFiles() {
   while [ -n "$1" ]
   do
   case "$1" in
   -3) cat /dev/null > ${tmptmp} ;;
   -4) cat /dev/null > ${tmpmenu} ;;
   -5) cat /dev/null > ${tmp_getcmd} ;;
   -6) cat /dev/null > ${tmp_goon} ;;
   esac
   shift
   done
}


Reply via email to