Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 written a script which opens a new terminal using gnome-terminal. The output shown on gnome-terminal is correct. I want this output should be in some file. I have tried this:

gnome-terminal -e 'bash -c "{ /usr/local/bin/kedr_capture_trace -b ; exec bash; }"' > outputfile   &

But it's not working. The output shown by gnome-terminal is correct but not captured in outputfile.

I have tried this too:

gnome-terminal -e 'bash -c "{ /usr/local/bin/kedr_capture_trace -b ; exec bash; } > outputfile"'   &

But in this case output is not shown by gnome-terminal.

How can I do this?

share|improve this question
Just what is the use of a terminal that doesn't output anything to screen? – grawity May 10 '12 at 14:01
Yes, provide an answer to the question "What are you really trying to do?" in the original post, please. – Daniel Andersson May 10 '12 at 14:04
You should register your account on Super User to become owner of this question again. Suggesting edits won't help much along the way, because you can't post comments here. – slhck May 12 '12 at 17:35

The shell is responsible for file redirection, not the terminal

gnome-terminal -e 'bash -c "{ echo foo; echo bar; exec bash; } > outputfile"'
share|improve this answer

I think the command script might be what you want.

share|improve this answer

Your Answer


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.