3 ms·
That's because it's a loop, so it's already read. Try appending a line to a running script instead.
by marcan_42 5y ago
That'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".