A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

run.sh 657B

1234567891011121314151617181920
  1. #!/bin/sh
  2. cd "$(dirname "$0")"
  3. . ./.env
  4. . venv/bin/activate
  5. trap 'echo "Caught Ctrl-C"' INT
  6. while [ 1 ] ; do
  7. LOGFILE=log-$(date +%Y%m%d-%H%M%S).txt
  8. python doctor.py logs/$LOGFILE
  9. if [ $(grep -c "JJ:" logs/$LOGFILE) -eq 0 ]; then
  10. rm logs/$LOGFILE
  11. elif dialog --title "Save session log?" --clear --defaultno --yesno "Save $LOGFILE?" 5 40 ; then
  12. # clear uncaught aborted logs
  13. grep -c "JJ:" logs/*.txt | grep ':0$'| sed 's/:.*//' | xargs rm
  14. python genlogs.py
  15. dialog --title "Session saved" --msgbox "Session saved to file $LOGFILE
  16. You may access it via WWW over LAN" 6 60
  17. else
  18. rm logs/$LOGFILE
  19. fi
  20. done