script-session 437 B

123456789101112131415161718192021
  1. #!/bin/sh
  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. mkdir ~/sessions
  10. fi
  11. script -f ${filename} --timing=${timingfile}
  12. cd ~/sessions
  13. git add ${date}-${subject}.sessionscript ${date}-${subject}.timing
  14. git commit
  15. cd $currentdir