What I want to achieve is be able to record my terminal sessions to file automatically whenever I use Yakuake/Konsole.
It's easy to achieve if at the start of my session I do:
script -f /home/$USER/bin/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log
But I want to run the above automatically whenever I start Yakuake or open a new tab.
Using .bashrc does not work because it creates endless loop as 'script' opens a new session, which in turn reads .bashrc and starts another 'script' and so on.
So presumably I need to script Yakuake/Konsole somehow to run 'script' once as a new tab gets opened. The question is how?
execat the start of the line. it should start thescript -fin the same shell PID. – Hanan N. Nov 29 '11 at 22:28