[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with bash script loading

From: Chet Ramey
Subject: Re: problem with bash script loading
Date: Sun, 6 Jan 2019 16:47:03 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

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    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]