Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have a script being started with gnome. that script is set to autostart with gnome automatically via system > preferences > startup applications. so where does the standard output of such an auto started program go?

To add some background information: I want to debug by analyzing the program's messages printed to its standard output. Just looking for the place where it goes. I remember, that the output is shown in the console when restarting gdm, but something like cat /dev/vcs7 does not help.

share|improve this question
    
to add some background information: i want to debug by analyzing the program's messages printed to its standard output. just looking for the place where it goes. i remember, that the output is shown in the console when restarting gdm. but something like cat /dev/vcs7 does not help. –  Anonymous Feb 12 '11 at 17:38
add comment

migrated from stackoverflow.com Feb 17 '11 at 1:41

This question came from our site for professional and enthusiast programmers.

2 Answers

stdout and stderr are eventually redirected in the X startup to ~/.xsession-errors, so all its children have that redirection as well.

share|improve this answer
    
technically it's done in the session startup scripts, or by GDM if that is used. –  Keith Feb 17 '11 at 3:31
    
@Keith: Thanks, fixed. –  Ignacio Vazquez-Abrams Feb 17 '11 at 3:33
add comment

You could redirect normal and error output at the beginning of your script like this:

#!/bin/bash

exec > /tmp/$0.$$.log 2>&1

...

echo "This text would go into the .log file"

Then when the script gets executed you'll be able to peek into the corresponding log file and see what's going on.

I hope this helps you!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.