mersenneforum.org console output to txt file
 Register FAQ Search Today's Posts Mark Forums Read

 2015-09-24, 12:42 #1 pepi37     Dec 2011 After milion nines:) 22×5×71 Posts console output to txt file I run mprime under console ( GUI -less) distro of Linux. Then I stop mprime How to save content of console ( and those lines which I cannot see) to text file. I try this for last few hours and I cannot find answer Once I found it and it was simple command, but now I cannot find it any more. Any help? Thanks
2015-09-24, 12:44   #2
rogue

"Mark"
Apr 2003
Between here and the

142378 Posts

Quote:
 Originally Posted by pepi37 I run mprime under console ( GUI -less) distro of Linux. Then I stop mprime How to save content of console ( and those lines which I cannot see) to text file. I try this for last few hours and I cannot find answer Once I found it and it was simple command, but now I cannot find it any more. Any help? Thanks
Try using ">" to redirect the output.

2015-09-24, 12:46   #3
pepi37

Dec 2011
After milion nines:)

26148 Posts

Quote:
 Originally Posted by rogue Try using ">" to redirect the output.
give me 0 bytes txt file.

2015-09-24, 13:16   #4
chalsall
If I May

"Chris Halsall"
Sep 2002

2×3×5×11×29 Posts

Quote:
 Originally Posted by pepi37 give me 0 bytes txt file.
Try something like "mprime -d | tee mprime_log.txt".

This will write the output of mprime to STDOUT (read: the console) as well as the mprime_log.txt file.

Keep in mind that it is possible you saw the 0 bytes because of buffering; the "-d" debugging flag increases the output from mprime.

 2015-09-24, 13:21 #5 Xyzzy     "Mike" Aug 2002 23×32×113 Posts Code: ./mprime -d >> /path/to/file/filename & Optionally, prepend "nohup" to the line to prevent the process from being killed if you close the terminal session. You can view the file "in real time" with: Code: tail -f /path/to/file/filename
2015-09-24, 14:09   #6
pepi37

Dec 2011
After milion nines:)

26148 Posts

Quote:
 Originally Posted by chalsall Try something like "mprime -d | tee mprime_log.txt". This will write the output of mprime to STDOUT (read: the console) as well as the mprime_log.txt file. Keep in mind that it is possible you saw the 0 bytes because of buffering; the "-d" debugging flag increases the output from mprime.
Mprime has been stopped!
So I wont all text that mprime produced while it was working send to some file for reading.

2015-09-24, 20:02   #7
Dubslow

"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts

Quote:
 Originally Posted by pepi37 Why dont you first read my post before answer it. Mprime has been stopped! So I wont all text that mprime produced while it was working send to some file for reading.
Notice how mprime is in the command he suggests?

Fundamentally, there is no way to get text from the terminal's stdout after the fact.

Re-read the above line, to be extra sure.

Now, having absorbed that, the question as you seem to demand it be answered, cannot be answered. Instead, you must specify in some way, when you *start* mprime, that you want to save the text. His suggestion is arguably the best way to do so.

Last fiddled with by Dubslow on 2015-09-24 at 20:03

2015-09-24, 21:06   #8
pepi37

Dec 2011
After milion nines:)

22·5·71 Posts

Quote:
 Originally Posted by Dubslow Notice how mprime is in the command he suggests? Fundamentally, there is no way to get text from the terminal's stdout after the fact. Re-read the above line, to be extra sure. Now, having absorbed that, the question as you seem to demand it be answered, cannot be answered. Instead, you must specify in some way, when you *start* mprime, that you want to save the text. His suggestion is arguably the best way to do so.
And I am sorry, but that is not true. As I say at my first post, I manage to do exactly what I need to do at same situation. And I will find way: if it was first time it will be on second also. It must be some kind of framebuffer where Linux as OS writes what is text in console.
Will find way..

2015-09-24, 21:37   #9
chalsall
If I May

"Chris Halsall"
Sep 2002

2·3·5·11·29 Posts

Quote:
 Originally Posted by pepi37 And I am sorry, but that is not true. As I say at my first post, I manage to do exactly what I need to do at same situation. And I will find way: if it was first time it will be on second also. It must be some kind of framebuffer where Linux as OS writes what is text in console. Will find way.. Thanks for answers
As we say here in Bim, Cheese on Bread (young children say this so they aren't slapped for being blasphemous)!

If you happen to have a GUI shell showing STDOUT, you can copy-and-paste the output.

Only idiots rely on that.

 2015-09-24, 21:41 #10 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2015-09-24, 21:56 #11 science_man_88     "Forget I exist" Jul 2009 Dumbassville 838410 Posts my two cents: http://stackoverflow.com/questions/3...-window-closes comes up when you google search console to text file after console closes ( no quotes) but it's about windows.

 Similar Threads Thread Thread Starter Forum Replies Last Post petrw1 Homework Help 14 2018-04-26 22:45 conere10 Software 7 2011-10-15 23:05 jasong Sierpinski/Riesel Base 5 1 2005-03-13 05:41 edorajh Software 8 2003-11-20 02:28 dsouza123 Programming 0 2003-09-28 20:40

All times are UTC. The time now is 04:40.

Thu May 6 04:40:16 UTC 2021 up 27 days, 23:21, 0 users, load averages: 3.39, 3.72, 3.78