Re: Negative indexes in ${arr[@]:off:length}

2011-06-27 Thread Greg Wooledge
On Sat, Jun 25, 2011 at 05:35:24PM +0200, lhun...@lyndir.com wrote: > arr=(a b c); echo "${arr[-1]}" > > In line with that, I'd like to propose extending that functionality to > other operations that address array elements: > echo "${arr[@]:0:-1}" # Expected: c > echo "${arr[@]:1:

Re: Negative indexes in ${arr[@]:off:length}

2011-06-27 Thread Chet Ramey
> I don't even understand what the second one is supposed to mean at > all -- the :1: means to start with "b" and the -2 means to go back 2 > elements...? How do you derive "a c" from any possible interpretation > of this? I assume that he wants to be able to treat an indexed array as a circular

Re: Negative indexes in ${arr[@]:off:length}

2011-06-27 Thread Steven W. Orr
On 6/27/2011 10:25 AM, Chet Ramey wrote: I don't even understand what the second one is supposed to mean at all -- the :1: means to start with "b" and the -2 means to go back 2 elements...? How do you derive "a c" from any possible interpretation of this? I assume that he wants to be able to t

bash doesn't run as a login when when -c specified

2011-06-27 Thread Todd . Miller
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: openbsd4.9 Compiler: cc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='openbsd4.9' -DCONF_MACHTYPE='x86_64-unknown-openbsd4.9' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/sha

Re: bash doesn't run as a login when when -c specified

2011-06-27 Thread Chet Ramey
On 6/27/11 11:28 AM, todd.mil...@courtesan.com wrote: > Machine Type: x86_64-unknown-openbsd4.9 > > Bash Version: 4.2 > Patch Level: 10 > Release Status: release > > Description: > Newer versions of bash appear to ignore the '-' in argv[0] > when the "-c" option is specified. Th