script-session 461 B

1234567891011121314151617181920212223
  1. #! /bin/zsh -f
  2. date=(`date +%F`)
  3. subject=(`echo $1 | sed -e "s/ /-/g"`)
  4. filename=~/sessions/${date}-${subject}.sessionscript
  5. timingfile=~/sessions/${date}-${subject}.timing
  6. currentdir=`pwd`
  7. #echo Recording session $1 as $filename
  8. if [ -d ~/sessions ] ; then
  9. sleep 0.05s
  10. else
  11. mkdir ~/sessions
  12. fi
  13. script -f ${filename} --timing=${timingfile}
  14. cd ~/sessions
  15. git add ${date}-${subject}.sessionscript ${date}-${subject}.timing
  16. git commit
  17. cd $currentdir