3 ms·
Is that what happened? I can't reproduce that by changing a bash script that's running a while [ 1 ] loop. Is it maybe that they were editing or copying the f
by tyingq 5y ago
Is that what happened? I can't reproduce that by changing a bash script that's running a while [ 1 ] loop.
Is it maybe that they were editing or copying the file and a cron job kicked off?
- marcan_42 5y agoThat's because it's a loop, so it's already read. Try appending a line to a running script instead.
- tyingq 5y agoAh, yep. This does work, and prints out both "one" and "two": printf "echo one\nsleep 3\n" > s1;(bash s1 &);sleep 1 && printf "echo two\n" >> s1 That's interesting. And changing the "sleep 1" to "sleep 4" make it only output "one".