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 20 Sep 2014, 20:16
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 [4 Posts]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5030
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

Last edited by sunburnt on Wed 21 Apr 2010, 20:54; edited 1 time in total
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3368
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: 5030
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: 5030
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 from previous:   Sort by:   
Page 1 of 1 [4 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.0447s ][ Queries: 12 (0.0037s) ][ GZIP on ]