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 Fri 01 Aug 2014, 09:53
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Hmm standard command not working as expected (SOLVED)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Wed 21 Jul 2010, 08:36    Post subject:  Hmm standard command not working as expected (SOLVED)  

Using Puppy Lucid 213

OK I'm in the middle of a script and place the following.

Code:
/sbin/iwconfig >  /tmp/iwstuff.txt


That should have re-directed stdout to the file but it doesn't, it's empty.
Backticks does nothing, trying exec closes script or closes cli !

This doesn't work in either a script or from command line. Command line does echo the output though ?

What's wrong, have I missed something ?

Just tried ifconfig > test.txt and it created a file with the stdout in it ????

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool

Last edited by tasmod on Wed 21 Jul 2010, 09:16; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Wed 21 Jul 2010, 08:55    Post subject: Re: Hmm standard command not working as expected  

tasmod wrote:

Code:
/sbin/iwconfig >  /tmp/iwstuff.txt

That should have re-directed stdout to the file but it doesn't, it's empty.

If iwconfig happens to be an empty file then so will be iwstuff.txt

Standard output will be directed to that file using your syntax. But if the output of iwconfig consists of both standard output and standard error, then to redirect both these outputs to a common file,
Code:
/sbin/iwconfig > /tmp/iwstuff.txt 2>&1

HTH
Back to top
View user's profile Send private message 
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Wed 21 Jul 2010, 09:12    Post subject:  

Doh, of course.

I was so hung up on 'ifconfig' working I forgot about stderr as I have no wireless 'iwconfig' would error as well.

Thanks.

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 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.0662s ][ Queries: 11 (0.0280s) ][ GZIP on ]