script-session 400 B

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