Not until midway through a 3 hour build script, I\'ll remember that I want to see something at the beginning of the output after it\'s done. At this point I\'ve exceeded th
My be you can use tee command to put the output to STDOUT as well to a file and then use it.
If you're looking purely for the return code of the last executed command, use echo $?
.
This usually helps when you want to find whether your last command executed successfully and you could also mould this into your build script for pass/fail alerts.
save output as a variable?
bash: Output=$(ls); echo $Output
script(1)
is exactly what you need:
script
make
exit
vim typescript
The script
program will start a new shell and save input and output to the typescript
file. When you're done, just close the shell with exit
or ^D
. If you'd rather not start a new shell but just run your build, you can use: script -c <command>
.
This is a function of your terminal. You should focus on creating a setup where you don't have to remember to do anything. One possible solution is to launch "screen" in your login script (which is not so easy to get right) with logging enabled.