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.