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 528B

12345678910111213141516
  1. #!/bin/sh
  2. cd "$(dirname "$0")"
  3. . ./.env
  4. . venv/bin/activate
  5. while [ 1 ] ; do
  6. LOGFILE=log-$(date +%Y%m%d-%H%M%S).txt
  7. python doctor.py|tee logs/$LOGFILE
  8. # Only 3rd '>' counts. We should also skip '<Enter>' in the header ;)
  9. if [ $(grep -c '>' logs/$LOGFILE) -lt 3 ] ; then
  10. rm logs/$LOGFILE
  11. dialog --title "Session aborted" --msgbox "Hit <Enter> to continue..." 5 60
  12. else
  13. python genlogs.py
  14. dialog --title "Session saved" --msgbox "Session saved to file $LOGFILE" 5 60
  15. fi
  16. done