What happens if I recompile an executable while it\'s running? Does the operating system read all of the executable\'s contents into memory when it starts running it, so it
It depends. From what I've experienced, on Linux you can still be running a program if you delete it (and it's not too large). But I don't think that's defined behavior.
As far as the loop goes, depending on how you're invoking the executable, you will likely end out crashing your script when it goes to execute a program that's only halfway been written.