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 Sat 25 Oct 2014, 03:21
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Why Xwin. test works in Xterm and not script? [ Solved ]
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Wed 21 Apr 2010, 13:31    Post_subject:  Why Xwin. test works in Xterm and not script? [ Solved ]  

The file: /tmp/xwin.error is empty when the code is run from a script.
But it works great in Xterm:
Code:
xwininfo -name "$1" 1> /dev/null 2> /tmp/xwin.error

Edited_time_total
Back to top
View user's profile Send_private_message 
8-bit


Joined: 03 Apr 2007
Posts: 3382
Location: Oregon

PostPosted: Wed 21 Apr 2010, 15:49    Post_subject:  

Routing it through /dev/null basically wipes out the information you are trying to get.
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Wed 21 Apr 2010, 18:43    Post_subject:  

No it doesn`t, the only thing being run to null is std. out.
Try it... 2> gets the error but outputs a screen full of info ( 1> ) if there`s no error.
So if the Xwin. title is good 1> sends the Xwin. info to the trash to keep the screen clean.

It`s writing the file every time now, but again... It works fine in Xterm but the script errors.

I took my error message out and now it doesn`t error any more... Weird!
The echo command seems to be the problem, it`s returning back to the function call!
But the if statement should end the script with " exit 7 ;fi" after that! But it never gets there!
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Wed 21 Apr 2010, 19:10    Post_subject:  

I solved it...
I moved the test out of that function and put it in it`s own function that`s called normally..

It seems running a function while evaluating it means it evaluates everything as it`s being run,
not just evaluating the returned values as you might expect..

The script works great now... I`ll show what I`m doing in a little bit.
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.0409s ][ Queries: 12 (0.0042s) ][ GZIP on ]