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 Wed 26 Nov 2014, 04:08
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 Posts_count  
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: 2278

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_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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0503s ][ Queries: 11 (0.0035s) ][ GZIP on ]