I have a script I would like to run when a terminal is opened. This will use the script
command to record the terminal session, to aid in troubleshooting the system after some software work is done. When I placed the script in .bash.d, and opened a terminal, it gets stuck in a loop repeatedly starting the script.
script -a -f ~/user_data/error_logs/terminal_output/typescript.$(hostname).$(date -I).txt
date >> debug.txt
orscript -a -c date debug.txt
and check for a loop.