[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Negative offset with variable expansion doesn't work
From:       prj () po ! cwru ! edu (Paul Jarc)
Date:       2002-05-21 15:31:11
Message-ID: m3lmadldpm.fsf () multivac ! cwru ! edu
[Download RAW message or body]

Chet Ramey <chet@nike.ins.cwru.edu> wrote:
>> echo ${var:-2:2}
>
> Of course.  The `:-' doesn't specify a negative offset.

But this is an easy mistake to make, given the text of the man page.
It would be helpful to mention that a negative value should be
parenthesized, or preceded by a space, or otherwise distinguished from
the :- case.


paul


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic