You are not logged in.

#1 2008-01-26 16:43:24

psyspy80
Member
From: London
Registered: 2008-01-26
Posts: 21

How to forward command output to the forum

Hi guys,

I am the newest archer! I installed it yesterday evenning and it was a great experience. I learnt more about Linux on that evening than with Ubuntu in half a year.

Now I am trying to figgure out how to get my wireless card to connect to my router. Unfortunately, it does not work. The problem now is that I can not properly ask for a solution because I have no idea how to forward the output of commands from a computer that can not connect to the network. sad

So far, base + madwifi + netcfg2 is installed

Any ideas?

Thanks

Last edited by psyspy80 (2008-01-26 18:54:16)

Offline

#2 2008-01-26 16:49:14

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: How to forward command output to the forum

Put it in a text file and transfer that with a usb stick or something? To put it in teh text file, execute the command like this:

command | tee -a <filename>

BTW: did you see this?

Offline

#3 2008-01-26 17:31:23

psyspy80
Member
From: London
Registered: 2008-01-26
Posts: 21

Re: How to forward command output to the forum

Brilliant, Ramses de Norre! And so fast lol

I managed to create those files, something strange happened though: When I put 'iwconfig | tee -a iwconfig', it lists all the network devices, including thoses which are not wireless. The file, however, only contains the wireless device. The other files are complete. Can you reproduce this?

Yes, I have seen the wiki page. These were the instructions I've followed but no success. I am going to open another tread for this problem and let you know which one.

Do you also know how I can put the contents of my files in these "ouput windows" which everyone uses? I will have to do that on Vista *puke*.

Offline

#4 2008-01-26 23:39:24

torkjel
Member
Registered: 2007-11-12
Posts: 13

Re: How to forward command output to the forum

I managed to create those files, something strange happened though: When I put 'iwconfig | tee -a iwconfig', it lists all the network devices, including thoses which are not wireless. The file, however, only contains the wireless device. The other files are complete. Can you reproduce this?

I guess using ubuntu didn't teach you the difference between stdout and stderr smile it goes like this: A command line program on linux (or any other unix variant) sees your console/terminal window as three different 'files'. One file called 'stdin' (standard input) for reading input from your keyboard, another file called 'stdout' (standard output) for writing ordinary text and lastly one called 'stderr' (standard error) for writing error messages. Anyting written to either stdout or stderr is show as  text in the console. For some reason the authors of iwconfig has decided that information about non-wireless devices should be treated as 'error' messages and is consequently written to stderr.

If you look at the man page for tee (run 'man tee') you'll see

Copy standard input to each FILE, and also to standard output.

. Stderr is not copied to the file! Fortunately there is a way to fix this:

iwconfig 2>&1 | tee -a iwconfig

This means 'run iwconfig, then copy everything from stderr to stdout and then pass that to tee through stdin'.

Read all about it at http://en.wikipedia.org/wiki/Standard_streams

By 'output window' i guess you mean 'quote' or 'code' bbcode tags... Click the 'BBCode' link under the comment textfield for an explanation smile

Offline

#5 2008-01-28 19:01:02

psyspy80
Member
From: London
Registered: 2008-01-26
Posts: 21

Re: How to forward command output to the forum

Thank you so much, everthing worked as it should.

If you guys are interested in solving my actual problem, then head over to

http://bbs.archlinux.org/viewtopic.php?id=43062

Hope to hear from you!

Offline

Board footer

Powered by FluxBB