A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
12345678910111213141516171819202122 |
- #!/bin/sh
- cd "$(dirname "$0")"
- . ./.env
- . venv/bin/activate
- trap 'echo "Caught Ctrl-C"' INT
- while [ 1 ] ; do
- LOGFILE=log-$(date +%Y%m%d-%H%M%S).txt
- python doctor.py logs/$LOGFILE
- # We expect at least
- # * '<Enter>' in the header
- # * first '>' prompt
- # A third '>' means at least a single prompt from the user
- if [ $(grep -c '>' logs/$LOGFILE) -lt 3 ] ; then
- rm logs/$LOGFILE
- dialog --title "Session aborted" --msgbox "Hit <Enter> to continue..." 5 60
- else
- # clear aborted logs that somehow weren't caught
- grep -c ">" logs/*.txt | grep ':[12]$'| sed 's/:.*//' | xargs rm
- python genlogs.py
- dialog --title "Session saved" --msgbox "Session saved to file $LOGFILE" 5 60
- fi
- done
|