[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash executes from files, not memory
From: |
tsurara |
Subject: |
bash executes from files, not memory |
Date: |
Tue, 27 Aug 2002 00:30:35 -0700 |
Hi,
When you edit and save a bash script that is executing, there is a risk that
bash will get confused about where it is in the script. Apparently bash reads
from the disk in real time instead of copying the script to memory first.
If the script is, say, a cron job run by root, and root happens to edit the
script at the time that it is executing, the script could remove files or cause
other undesired effects.
With today's memory sizes, even on palmtops, perhaps this default can be
changed.
To recreate, create a bash script that executes slowly (sleep 60 will do) and
has some commands after the slow part, run the script, (from another shell)
edit it again while it is running (making sure to make length changes that
occur before the sleep command), save your changes, and wait for the running
process to result in errors.
GNU bash, version 2.05a.0(1)-release (i386-pc-linux-gnu)
Debian woody, standard bash installation.
Thanks.
tsurara
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bash executes from files, not memory,
tsurara <=