A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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