Modifying running script leads to unpredictable result

2013-12-01 Thread Teika Kazura
Version: all(?), including bash-4.2, patch 45

Hi, bash developers. If you edit a running bash script file, the result is 
unpredictable. [1] This is bad for long time running scripts.

[1] See for example, http://stackoverflow.com/questions/3398258/

I guess a fix won't be difficult. In fact, a user-side workaround[2] is to put 
the entire code inside a brace, as:

#!/bin/bash

{
  

  exit
}


[2] http://stackoverflow.com/a/2358432/780703

By doing so, bash reads the code body before execution. (The last "exit" is 
necessary. See the cited page.)

This seems to mean that with slight changes of the source, bash must be able to 
read the entire script before execution.

This may partly be an enhancement request rather than a bug report. Anyway 
thank you very much for reading.

Best regards,
Teika (Teika kazura)



Re: Bash-4.3-beta2 available for FTP

2013-12-01 Thread Dan Shelton
On 14 November 2013 17:33, Cedric Blancher  wrote:
> On 12 November 2013 17:58, Chet Ramey  wrote:
>> On 11/7/13 10:31 AM, Simon Toedt wrote:
>>
 Yes.  There are a few issues with the bash-20131025 snapshot.  I've
 attached a patch that fixes them.
>>>
>>> Chet, can you push the patch to git to avoid that other people stumble
>>> over that build issue, please?
>>
>> I pushed another snapshot this morning.
>
> Thank you. Seems to work fine :)
>
> Ced
> --
> Cedric Blancher 
> Institute Pasteur
>

Seems to be working OK in bash4.3 rc1, too.

Chet, Cedric, thank you!

Dan



Bash-4.3-rc1 available for FTP

2013-12-01 Thread Chet Ramey
The first release candidate of bash-4.3 is now available with the URL

ftp://ftp.cwru.edu/pub/bash/bash-4.3-rc1.tar.gz

This tar file does not include the formatted documentation (you
should be able to generate it yourself).

This release fixes many outstanding bugs in bash-4.2 and introduces several
new features.  The most significant bug fix is the reworking of signal
handling to avoid running signal and trap handlers in a signal handler
context.  This led to issues with glibc, which uses internal locks
extensively and handles longjmps from user code very poorly.

The most notable new features are the `globasciiranges' shell option, which
forces the pattern matching code to treat [a-z] as if in the C locale;
nameref variables and the changes to allow assigning, referencing, and
unsetting them; improvements to the `direxpand' option introduced in bash-4.2
patch 29; and allowing negative subscripts when assigning and referencing
indexed array elements.

There is one incompatible change between bash-4.2 and bash-4.3.  Bash now
performs quote removal on the replacement string in pattern substitution
(${param/pat/rep}), since the shell treats quotes as special.  If you
have to quote single quotes to get them to be treated literally, the shell
should perform quote removal on them.

`bashbug' may be used to report bugs with this version.  It will send
mail to c...@po.cwru.edu if the shell's `release status' is alpha or
beta.

As always, thanks for your help.

Chet

+== CHANGES ==+
This document details the changes between this version, bash-4.3-rc1, and the
previous version, bash-4.3-beta2.

1.  Changes to Bash

a. Fixed a bug in bash completion that caused a tilde to be expanded even if
   the `direxpand' option was not enabled.

b. Fixed a potential bug that could cause corrupted input in interactive shells
   running without line editing and with `ignoreeof' enabled.

c. Fixed a bug that could cause failures when opening pipes back to shells
   created to run process substitutions.

d. Fixed a bug that caused an assignment to TEXTDOMAIN to require TEXTDOMAINDIR
   to be set in order to actually change the current text domain.

e. Changed the way redirections are printed to avoid confusion when the target
   of an output redirection is a process substitution beginning with `>'.

2.  Changes to Readline

a. Shared library building is now supported on Mac OS X 10.9 (Darwin 13).

3.  New Features in Bash

a. `cd' has a new `-@' option to browse a file's extended attributes on
   systems that support O_XATTR.

4.  New Features in Readline

a. There are additional default key bindings for MinGW32

--
This document details the changes between this version, bash-4.3-beta2, and the
previous version, bash-4.3-beta.

1.  Changes to Bash

a.  Fixed a bug that caused assignment to an unset variable using a negative
subscript to result in a segmentation fault.

b.  Fixed a bug that caused assignment to a string variable using a negative
subscript to use the incorrect index.

c.  Fixed a bug that caused some strings to be interpreted as invalid
extended globbing expressions when used with the help builtin.

d.  Fixed a bug that caused an attempt to trap a signal whose disposition
cannot be changed to reference uninitialized memory.

e.  Command completion now skips assignment statements preceding a command
name and completes the command.

f.  Fixed a bug that caused `compgen -f' in a non-interactive shell to dump
core under certain circumstances.

g.  Fixed a bug that caused the `read -N' to misbehave when the input stream
contains 0xff.

2.  Changes to Readline

a.  Changed message when an incremental search fails to include "failed" in
the prompt and display the entire search string instead of just the last
matching portion.

b.  Fixed a bug that caused an arrow key typed to an incremental search prompt
to process the key sequence incorrectly.

c.  Additional key bindings for arrow keys on MinGW.

3.  New Features in Bash

a.  The help builtin now attempts substring matching (as it did through
bash-4.2) if exact string matching fails.

b.  The fc builtin now interprets -0 as the current command line.

c.  Completing directory names containing shell variables now adds a trailing
slash if the expanded result is a directory.

4.  New Features in Readline

a.  rl_change_environment: new application-settable variable that controls
whether or not Readline modifies the environment (currently readline
modifies only LINES and COLUMNS).

--
This document details the changes between this version, bash-4.3-beta, and the
previous version, bash-4.3-alpha.

1.  Changes to Bash

a.  Fixed a bug in the prompt directory name "trimming" code that caused
memory corruption and garbled the results.

b.  Fixed a bug tha

history undo bug

2013-12-01 Thread gregrwm
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/loc
uname output: Linux jocur 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9
16:12:00 UTC 2013 i686 athlon i686 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 4.2
Patch Level: 45
Release Status: release

Description:  change a history line, undo the change, the line still shows
as changed in history listing
Repeat-By:
   use uparrow to return to a prior command in bash history
   make a change
   use downarrow to leave the changed history line
   use uparrow to return to the changed history line
   use ^_ to undo the change
   use downarrow to leave the restored history line
   use uparrow to return to the restored history line, and/or produce a
history listing
   observe that the change is "un-restored", and the mark-modified-lines
asterisk is not displayed