Now trying to compile the sources 2.12r.
Thanks for the hint! It just looks like what I need![div align=\"right\"][a href=\"index.php?act=findpost&pid=158420\"][{POST_SNAPBACK}][/a][/div]
Glad I could help. Don't forget to share
[div align=\"right\"][a href=\"index.php?act=findpost&pid=158438\"][{POST_SNAPBACK}][/a][/div]
Of course I won't!
So here is the solution:
Attached is the script utility (stripped binary only, compiled for pdaXrom 1.1.0beta3), just unzip and copy it to /usr/bin).
I have also developed a nice trick to make usage of "script" totally transparent to the user, so the user still only has to call the shell script as usual.
Normally, in order to create a log from a shell script execution, you need to call the script with "script" this way:
script -c "shellscript.sh" logfilename
This can be automated within the actual shell script to be executed and logged.
Just put these lines at the beginning of the shell script:
TODAY=`date +%Y-%m-%d_%Hh%M`
if [ ! "$1" = "run" ]; then
script -c "$0 run" ${TODAY}_LOGFILE
echo Created logfile ${TODAY}_LOGFILE
exit 0
fi
So when calling the shell script as usual, it actually calls "script" which, with the -c parameter, calls the shell script recursively once more to execute its actual contents.
The "run" parameter is used to determine if the user calls the script (go into the "if") or if script has called it (run the actual script contents).
In the above example, "script" will create a logfile in the currect directory with the name (for example)
2007-04-11_09:25_LOGFILE
Interactivity of the shell script, here using mainly echo and read, is fully preserved.
Thank you for your help!
daniel