How to make the variable "DEF_APP" to work inside this function?
Example:
Code: Select all
#!/bin/sh
export DEF_APP="myapp"
func_defaultapp () {
Xdialog --title "$(gettext 'Installation') - $(gettext 'Information')" icon /usr/local/lib/X11/pixmaps/question.png --stdout --yesno "$(gettext 'Do you want this application to be set as default?')" 0 0
case $? in
0)echo '#!/bin/sh
exec $DEF_APP "$@"' > /root/defaultapptest
;;
1)Xdialog --title "$(gettext 'Installation') - $(gettext 'Information')" --no-buttons --infobox "$(gettext 'Canceled...')" 3 50
;;
255)Xdialog --title "$(gettext 'Installation') - $(gettext 'Information')" --no-buttons --infobox "$(gettext 'Canceled...')" 3 50
;;
esac
}
export -f func_defaultapp
func_default
Code: Select all
#!/bin/sh
exec $DEF_APP "$@"
Code: Select all
#!/bin/sh
exec myapp "$@"
Thank you!
Cordialement.