Greg Wooledge wrote:
> On Sun, Sep 08, 2013 at 11:21:56AM -0500, Dennis Williamson wrote:
>> The man page says "Note that a negative offset must be separated from the
>> colon by at least one space..."
> 
> Enclosing the negative offset in parentheses also works.
> 
> The reason you must use either parentheses or spaces between them is
> because ${parameter:-word} has another, completely different meaning.
> 
>   ${foo:-1}
> 
> will expand to the contents of `foo' if it is set and not empty, or the
> literal string `1' otherwise.


Messieurs,

please excuse my stupidity. Although I'm using bash relatively often
including 'use default value' construct (${parameter:-word}), in this
case I somehow not joined this together.

And my failure to properly read through man page I rather will not
comment...

Thanks, Franta Hanzlík



Reply via email to