Re: [List] Re: Nice easy sed question

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Mon, 15 Sep 2025 17:45:34 UTC
Bob Proulx <bob@proulx.com> writes:
> The FreeBSD sh shell is not a strict POSIX shell

Technically correct.

> and implements this ksh-ism so strictly speaking that is not portable
> but it does work.

Incorrect, dollar-quoted strings are part of POSIX.

> This is what POSIX has to say about it.
>
>     The '$' character is used to introduce parameter expansion, command
>     substitution, or arithmetic evaluation. If an unquoted '$' is followed
>     by a character that is not one of the following:

You are looking in the wrong place.  See XCU 2.2.4:

https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_02_04

> The result of $'...' such as $'\n' is strictly speaking "unspecified"
> behavior by the standard.

On the contrary, it is perfectly well-defined.

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org