Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

    
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
    
up vote 2 down vote accepted

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .