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? the first google results didn't fit...

link|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
feedback

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.

link|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
feedback

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!

link|improve this answer
feedback

Your Answer

 
or
required, but never shown