Date:Sun, 29 Jun 2025 08:13:07 -0600
From:Stan Marsh
Message-ID:
| So, is this POSIX, or just a dash-extension?
It is original Bourne Shell (from 7th edition Bell Labs Unix)
and is (or should be) supported by every Bourne-compatible shell.
It definitely is in POS
>"Note that a negative offset must be separated from the [non-following]
>colon by at least one space to avoid being confused with the ':-'
>expansion,' since a negative offset can exist immediately beside a
>subsequent colon.
>Wiley
Note, incidentally, that it is not strictly true that a negat
And here is another interesting thing inspired by this thread.
I always thought the "colon-free" versions of the P.E. was a bash-ism, but
experimentation shows that it works in "dash" as well. And "man dash" contains
the following text:
In the parameter expansions shown previously, use of the
On Sun, Jun 29, 2025 at 21:51:52 +0700, Robert Elz wrote:
> Date:Sun, 29 Jun 2025 08:13:07 -0600
> From:Stan Marsh
> Message-ID:
>
> | So, is this POSIX, or just a dash-extension?
>
> It is original Bourne Shell (from 7th edition Bell Labs Unix)
> and is (or shoul
On Sun, Jun 29, 2025 at 06:39:18 -0600, Stan Marsh wrote:
> Note, incidentally, that it is not strictly true that a negative offset has
> to be preceded by a space. A zero will work as well. And I think that is
> clearer. I.e., instead of:
>
> # Print the last 2 characters of $HOME
> $ echo ${H
On Sun, Jun 29, 2025, at 11:41 AM, Greg Wooledge wrote:
> The colon variants ${var:-word} were added later, IIRC by ksh.
Looks like the System III shell released them first:
https://www.in-ulm.de/~mascheck/bourne/#system3
--
vq