Recently, I have found the article about editing shell script while it's running.
Edit shell script while it's running
I prepared that code to reproduce the phenomenon with additional python script calling. I found echo
in bash was NOT affected by editing while python script was affected.
Could someone explain this phenomenon? I have expected that all std outputs should be "modified".
- test.sh
#!/bin/bash
sleep 30
echo "not modified"
python my_python.py
echo "not modified"
- my_python.py
print("not modified")
- Output result
$ bash test.sh // while sleeping, I edited test.sh and my_python.py to "modified"
not modified
modified
not modified