On 1/5/19 3:28 AM, Paulo Nogueira wrote: > What occurred to me is the following: suppose a script s1 starts > being executed, by forking say, and then s1 is overwritten; bash > detects this and re-reads the file.
Bash doesn't do that. > OK, then exactly where does > bash continue executing the script s1 if changes were made > throughout the file, even before the current location pointer? Bash seeks backward, in files that are seekable, to cancel the effects of internal readahead and buffering. It executes the remainder of the script exactly from where the input composing the last command ended. It doesn't close the file descriptor. POSIX says you have to do this when reading from standard input, anyway. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/