[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash edited while running
From: |
Eduardo A . Bustamante López |
Subject: |
Re: bash edited while running |
Date: |
Mon, 21 Oct 2013 14:27:47 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
In this case, the problem is in how you deploy the scripts, and not
with bash. Don't change a running script, just write the new script
to a temp file and then replace the script.
That looks something like this:
mv newscript oldscript
This way, bash will keep reading from oldscript, but new instances of
the script will use newscript instead. That's not just a bash issue,
but a general problem with deployments where you want to avoid
serving inconsistent content (some files updated and some not),
that's why you usually write everything to a location on the same
filesystem, and just issue a mv, which uses rename(2) under the hood.
Note that replacing a file is not the same as editing the file in
place.
So, fix your environment, it's not a bash issue.
--
Eduardo Alan Bustamante López