bug-bash
[Top][All Lists]
Advanced

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

Re: Bash does not read up the whole script which it is currently executi


From: Greg Wooledge
Subject: Re: Bash does not read up the whole script which it is currently executing
Date: Tue, 4 Aug 2009 11:40:04 -0400
User-agent: Mutt/1.4.2.2i

On Tue, Aug 04, 2009 at 08:23:16AM -0700, John Reiser wrote:
> On 08/04/2009 12:48 AM, famzah@icdsoft.com wrote:
> >     The problem is that Bash does not read up the whole script which it 
> >     is currently executing.
> >     As a result of this, if we update the script file with a newer 
> >     version while it is running, this may lead to unpredicted results.

> To avoid this feature, then use the "-c" parameter to specify the entire 
> shell input
> as a string on the command line:
>       bash -c "$(< filename)"
> Or, make a temporary unique copy of the file, then invoke the shell on the 
> copy.

Or upgrade your scripts like this:

  mv -f /path/to/script /path/to/script.old
  cp newscript /path/to/script

(Or remove-then-copy, or make /path/to/script a symlink to a
version-stamped copy, or any number of other ways that are not
"vi /path/to/script".)




reply via email to

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