error when exporting a function in gtkdialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

error when exporting a function in gtkdialog

#1 Post by hannysabbagh »

Hello.

i have this error when i try to export a function in gtkdialog 0.8.2:

Code: Select all

12: export: Illegal option -f
here is the line 12:

Code: Select all

export -f theme_list 
here is theme_list function:

Code: Select all

theme_list() {
ls -d /usr/share/themes/*/gtk-2.0 | awk -F"/" '{print $5}' 
}
any help?
thanks.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

What shell is being used -what is the first line of the script? Sounds like you are using ash instead of bash.

hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

#3 Post by hannysabbagh »

i use #!/bin/sh

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#4 Post by akash_rawal »

My testing:

Code: Select all

# #Current shell is bash
# theme_list() {
> ls -d /usr/share/themes/*/gtk-2.0 | awk -F"/" '{print $5}'
> } 
# export -f theme_list 
# #No problem
#
# #Retrying with ash...
# ash
# theme_list() {
> ls -d /usr/share/themes/*/gtk-2.0 | awk -F"/" '{print $5}'
> } 
# export -f theme_list 
ash: export: illegal option -f
# 
So changing #!/bin/sh to #!/bin/bash should solve the problem. But you will have to sacrifice a bit in portability.

hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

#5 Post by hannysabbagh »

Hello.

i can run the program if i changed it to bash, the problem is that my function won't work if i did that :(

is there anyway to keep my function working? because i use it in a combobox as an input, if i changed it to bash, the input won't show anything.

thanks.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#6 Post by Karl Godt »

There had been issues with racy-5.2 gtk-2.24.5 using the <combobox> tag .
<comboboxtext> is the newer, not deprecated, tag .
<comboboxtext> might work with gtkdialog4 , not with gtkdialog3 .

hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

#7 Post by hannysabbagh »

Thanks.

i did that but it still the same,
by the way, i am on Ubuntu 13.04 and i use gtkdialog 0.8.2 :)
thanks.

hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

#8 Post by hannysabbagh »

Hi agian.

the problem has been fixed.. i don't know how!
i just tried to run the code more often times.. and it worked alone!

LOL!

Thank you all for your help.

Post Reply