groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: utmac -muh error on Ubuntu


From: John Ankarström
Subject: Re: utmac -muh error on Ubuntu
Date: Wed, 7 Jul 2021 00:23:49 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

Den 2021-07-07 kl. 00:09 skrev John Ankarström:
> In any case, the POSIX-compatible equivalent is
>
>    echo .ds head-str `printf %s "$str" | tail -c1`

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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]