Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 18 Sep 2014, 15:47
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
error when exporting a function in gtkdialog
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: 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
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2247

PostPosted: 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
View user's profile Send private message 
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: Tue 18 Jun 2013, 03:15    Post subject:  

i use #!/bin/sh
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: 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
View user's profile Send private message 
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: 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 Sad

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
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: 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
View user's profile Send private message Visit poster's website 
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: 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 Smile
thanks.
Back to top
View user's profile Send private message 
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0513s ][ Queries: 12 (0.0041s) ][ GZIP on ]