I successfully use my e-mail history and IM logs to great extent when doing post mortems or other general reports. I should have that same functionality at my command prompt. And something a little more useful than "cat ~/.history". Script is handy for this (though an unfortunately hard name to google for). But I want to not have to worry about those pesky filenames so I did up a quick startlog script.
LOGDIR="/home/ben/logs/" #where we store teh logs
ITERATION=0 #start off at 0
if [ -n "$1" ] #this is what the filename will be prefixed with
#echo -n "$PREFIX"
while [ "$STARTED" -eq "0" ]
if [ ! -e $LOGDIR$PREFIX-$DATE-$ITERATION.log ]
echo -n "Logging to $LOGFILE"
I set my PS1 prompt to also show the current time to allow me to have everything timestamped. And, handily enough, I export the log filename to the shell which leads to a new alias in .bashrc:
alias sendlog="cat $LOGFILE | mail -s '$LOGFILE Transcript'"
I haven't actually used this yet but the novelty of it is handy. On a downside, cygwin does not have script which is a real bummer.
I still think this functionality should be built into rxvt, gnome-terminal, konsole, terminal.app, etc. Don't even get me started on cmd.exe "featureset".
Kunjungi Website KitaReplyDelete
Bantal Silikon Murah
Kunjungi Website Marinir Seo