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 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
1  
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

2 Answers 2

I think the command script might be what you want.

share|improve this answer

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

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.