Author |
Message |
hannysabbagh
Joined: 14 Apr 2013 Posts: 17
|
Posted: Tue 18 Jun 2013, 02:18 Post subject:
error when exporting a function in gtkdialog |
|
Hello.
i have this error when i try to export a function in gtkdialog 0.8.2:
Code: | 12: export: Illegal option -f |
here is the line 12:
Code: | export -f theme_list |
here is theme_list function:
Code: | theme_list() {
ls -d /usr/share/themes/*/gtk-2.0 | awk -F"/" '{print $5}'
}
|
any help?
thanks.
|
Back to top
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 2641
|
Posted: Tue 18 Jun 2013, 02:55 Post subject:
|
|
What shell is being used -what is the first line of the script? Sounds like you are using ash instead of bash.
|
Back to top
|
|
 |
hannysabbagh
Joined: 14 Apr 2013 Posts: 17
|
Posted: Tue 18 Jun 2013, 03:15 Post subject:
|
|
i use #!/bin/sh
|
Back to top
|
|
 |
akash_rawal
Joined: 25 Aug 2010 Posts: 232 Location: ISM Dhanbad, Jharkhand, India
|
Posted: Tue 18 Jun 2013, 04:06 Post subject:
|
|
My testing:
Code: |
# #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.
|
Back to top
|
|
 |
hannysabbagh
Joined: 14 Apr 2013 Posts: 17
|
Posted: Tue 18 Jun 2013, 05:01 Post subject:
|
|
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.
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 4208 Location: Kiel,Germany
|
Posted: Tue 18 Jun 2013, 13:57 Post subject:
|
|
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 .
|
Back to top
|
|
 |
hannysabbagh
Joined: 14 Apr 2013 Posts: 17
|
Posted: Tue 18 Jun 2013, 14:31 Post subject:
|
|
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.
|
Back to top
|
|
 |
hannysabbagh
Joined: 14 Apr 2013 Posts: 17
|
Posted: Tue 18 Jun 2013, 14:36 Post subject:
|
|
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.
|
Back to top
|
|
 |
|