John Ankarström <j...@ankarstrom.se> writes:

> Den 2021-07-07 kl. 00:09 skrev John Ankarström:
> Ah! There is a simpler solution:
>
>    echo .ds head-str ${str#"${str%?}"}
>
> Now that's elegant... and POSIX-compatible.
>
> Note the necessary quotation marks around ${str%?}
> (in case $str contains glob characters).

Nice solution, it fixes the macro for my test file.

 -Valtteri
 

Reply via email to