Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15002 > unrolled thread

problem with bash script loading

Started byPaulo Nogueira <paulo@cefema-gt.ist.utl.pt>
First post2018-12-29 12:09 +0000
Last post2018-12-29 12:09 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

  problem with bash script loading Paulo Nogueira <paulo@cefema-gt.ist.utl.pt> - 2018-12-29 12:09 +0000

#15002 — problem with bash script loading

FromPaulo Nogueira <paulo@cefema-gt.ist.utl.pt>
Date2018-12-29 12:09 +0000
Subjectproblem with bash script loading
Message-ID<mailman.6519.1546090995.1284.bug-bash@gnu.org>

Bash Version: 4.4
Patch Level: 19
Release Status: release


Configuration Information:
Machine: x86_64
OS: linux-gnu
Compiler: gcc



Description:

  I've come to the conclusion that bash scripts

  (1) are not entirely loaded in memory at once

  or, at least,

  (2) are re-read (from the disk?) if the file is updated

  Something tells me this is a really bad idea (if it turns
  out to be a "feature" and not a bug), because if a script
  is launched with "&" and then the file is edited/updated,
  the result will be unpredictable.



Repeat-By:

  Create an empty directory, and then two script files
  s1 and s2, contents given below (enclosed by '--')

  s1:
--
#!/bin/bash
#
  sleep 3
#
  \rm -f f1
#
  exit
#
--

  s2:
--
#!/bin/bash
#
  sleep 1
#
  \rm -f f2
#
  exit
#
--

  Now execute

# touch f1 f2
# ( ./s1 & ) ; sleep 1 ; \cp -f s2 s1

  and see f2 disappear, not f1 .


  Best regards,
   Paulo Nogueira

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web