Is there anything that's similar to "script" but does not require the terminal to be open?
I want to save the results from my program into a file, however I have some issues. I need to work remotely but I have bad internet connection. Thus I usually run:
./MyProgram.exe > output.txt &
And the results from my program are saved into the output.txt file.
However, when I run my program on certain objects I received a "SIGSEGV: Segmentation fault" error. The program quits and that is okay, I know it will do this. But I end up loosing all my data from previous objects before the program came across this problematic object that causes the errort.
How can I record everything, the results from the non-problematic objects as well as this error, into a file/s?
I have tried:
./MyProgram.exe > output.txt 2>&1 &
./MyProgram.exe > output.txt 2> error.txt &
./MyProgram.exe > & error-n-output.txt &
But all of the above just record the segmentation error but not the results from the previous objects, even though I know the program does work for the previous objects.
I have also tried the script
command by typing as follows:
Myname@Computer ~/Folder $ script screen.log
Script started, file is screen.log
Myname@Computer ~/Folder $./MyProgram.exe
~~~THE RESULTS AND THE SEGMENTATION ERROR ARE PRINTED ON SCREEN SO I CAN RECORD THE RESULTS FOR SOME OBJECTS AND IGNORE THE ERROR~~
Myname@Computer ~/Folder $ exit
exit
Script done, file is screen.log
And everything that was on screen is recorded in the screen.log file. This may be fine, however, due to my bad internet connection I cannot leave the screen running for a long time. I need to exit from the terminal but of course my program quits and nothing is written in the "screen.log" file.
Is there anything that's similar to script
but does not require the terminal to be open?
screen
is for.static
, do you meanscript
?screen
is a very common/popular utility. It comes pre-installed on the majority of Linux distributions (and I think, modern UNIX variants, in general). if it's not installed by default.. It probably should be.static
. What is that?