Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
redirecting output of a console program to a file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Thu Oct 03, 2002 4:09 pm    Post subject: redirecting output of a console program to a file Reply with quote

i am having problems with quake3 atm, it freezes up X and doesnt start. therefore i have got to look at the console output from quake3 as it starts up, but i cant as i have to restart X when q3 freezes. how do i direct the output to a text file so i can have a look at it?
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
ShadyMilkman
n00b
n00b


Joined: 20 Apr 2002
Posts: 57

PostPosted: Thu Oct 03, 2002 4:15 pm    Post subject: Reply with quote

There is a way to redirect output with the > operator, but that doesn't work if the program is outputting to stderr (standard error) instead of stdout (standard out). Anyway, try this:

[bum@hobomobile hobo$] quake3 > error.log

if that doesn't work it means that it's outputting the errors to stderr and afaik there's no way to capture that output.
Back to top
View user's profile Send private message
thegarbageman
n00b
n00b


Joined: 28 Apr 2002
Posts: 74
Location: Overland Park, KS

PostPosted: Thu Oct 03, 2002 4:15 pm    Post subject: Reply with quote

You can try running quake in a terminal - then use the ">" character to redirect to a file.

Code:
quake3 > output.txt


I am not sure of the executable file's name, as I don't play it, so just substitute "quake3" for the actual file's name
This may not work, however (depending on the exact method quake uses to output error messages.)

(edit) ha ha two simultaneous posts - at least if it outputs to stderr, you will be able to read it in the terminal window.


Last edited by thegarbageman on Thu Oct 03, 2002 4:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Thu Oct 03, 2002 4:43 pm    Post subject: Reply with quote

You can use &> to redirect standard error. I.e.
Code:
# command &> log.txt

_________________
"An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Oct 03, 2002 5:53 pm    Post subject: Reply with quote

"2>&1" will additionally duplicate stderr onto stdout, so they will both go to the same place.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
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