2 ms·
Instead of saying: while true You can instead say: while : There is actually a /bin/true, which could involve the fork of a new process for each iterati
by chasil 3y ago
Instead of saying:
while true
You can instead say:
while :
There is actually a /bin/true, which could involve the fork of a new process for each iteration of the loop. The form that I have shown you is guaranteed not to fork.
- z_zetetic_z 3y agoThank you sir!
- chasil 3y agoYou might find it interesting to know exactly what is (and is not) in the POSIX shell. The description of the colon : operator is there. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V... Most of the familiar userland utilities are at that website, accessible as a (somewhat crude) Apache index: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ Any POSIX-compliant system is required to implement the functionality described there.