Re: Positional parameter & array slicing bug with empty arguments

2014-01-12 Thread Theodoros V. Kalamatianos
On Sun, Jan 12, 2014 at 09:52:22AM +0200, Pierre Gaston wrote: patch 32 seems to have caused this It seems to me that the bug patch 032 addresses is slightly less troubling than having arrays break out of the blue. DEL characters are probably less common than empty array elements in shell sc

Re: Some Special Array Variables Only Kind Of Initialized

2014-01-12 Thread John R. Graham
On 01/11/2014 06:18 PM, Chet Ramey wrote: You don't want the value generated in all cases. This has an effect on some variables: RANDOM, for example. I believe the current behavior is preferable. I guess I don't understand why returning stale values for the dynamic variables under any circum

Re: Positional parameter/Array slicing bug with empty arguments

2014-01-12 Thread Chet Ramey
On 1/11/14, 7:01 PM, Theodoros V. Kalamatianos wrote: > Hi, > > I have bumped into a rather strange issue: > > $ set -- ''; printf "=%s=\n" "$@" x > == > =x= > $ set -- ''; printf "=%s=\n" "${@:1}" x > =x= > [...] > > I encountered this on bash-4.2.037, as provided by the Mageia 3 Linux

Re: Positional parameter & array slicing bug with empty arguments

2014-01-12 Thread Chet Ramey
On 1/12/14, 4:13 AM, Theodoros V. Kalamatianos wrote: > On Sun, Jan 12, 2014 at 09:52:22AM +0200, Pierre Gaston wrote: > >> patch 32 seems to have caused this > > It seems to me that the bug patch 032 addresses is slightly less troubling > than having arrays break out of the blue. Let's rein in

Strange problem with source

2014-01-12 Thread Cecil Westerhof
Is this a known problem? I have a strange problem with source. Sometimes variables are not defined, but functions are. I have a file a with: function includeFile() { local fileName local needsToExist=true if [[ ${1} == "--notNeeded" ]] ; then needsToExist=

Re: Strange problem with source

2014-01-12 Thread Bert Barbe
I think what happens is the following: "Using declare limits the scope of the variable." Since the source of b happens inside the function includeFile, the declare of testVariable happens inside that function, and it's scope is limited to that function. Kind regards, Bert On 01/12/2014 01:31