Re: Error on arithmetic evaluation of `~0`.

2018-12-23 Thread Bize Ma
Chet Ramey () wrote: > > > > While this works: > > > > var=(hello); echo "${var[ ~0]}" > > hello > > Because negative array subscripts count backwards from the end of the > array. > Doh!, yes. And, because of that: "${var[-1]}" should give the *last* element of array "var", shouldn't it? Consequ

Re: Unexpected delay in using arguments.

2018-12-23 Thread Bize Ma
Chet Ramey () wrote: > On 8/15/18 3:36 AM, Bob Proulx wrote: > > > It does look like bash can be more efficient with argument handling. > > Since, for example, dash does it. > > Yes, it just needs new primitives to do it. The existing code for managing > the saved positional parameters has been in

Re: 'eval' exit behaviour in posix mode

2018-12-23 Thread Martijn Dekker
Op 14-12-18 om 14:29 schreef Chet Ramey: On 12/14/18 6:46 AM, Martijn Dekker wrote: In current git, 'bash -o posix' no longer exits the shell on a syntax error in the argument to the special builtin 'eval'. Bash 4.2-4.4 exit as POSIX specifies. Well, not quite. It's the specific case of an une

Re: Memory continusely increase

2018-12-23 Thread chen liu
Chet Ramey 于2018年12月22日周六 上午12:51写道: > > On 12/19/18 1:10 AM, jake wrote: > > Hi all, > > > > I did a test about run a bash scriplt never quit,but met a memory usage > > issue that cause used memory continuous increase. > > This issue was present in bash-3.2.x, bash-4.0.x, bash-4.1.x, bash-4.2.x,