"Erik-Jan Taal" <[EMAIL PROTECTED]> wrote: > Now watch the terminal where the script was still running. I would > expect no output to be given, as I assumed the script is read into memory > at startup and not during execution and this is what happens on most > systems. On one server however, the 'bla' is echoed.
There are no guarantees here, except that each top-level statement is entirely read before being executed. Reading beyond the next command to be executed can vary from one system to another, depending on stdio buffering from libc. So if you want to be sure that each execution isn't affected by edits made while it is running, wrap the whole thing in a compound statement that exits before returning: #!/bin/sh { ... exit } paul