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 24 Oct 2014, 22:56
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 Posts_count  
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

Edited_time_total
Back to top
View user's profile Send_private_message Visit_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_website 
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.0426s ][ Queries: 11 (0.0044s) ][ GZIP on ]