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 21:14:35 +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. 10:16 skrev Valtteri Vuorikoski:
>> 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.

I should add that I forgot quotation marks around the whole thing.  It
might also expand to a glob character... The correct code is

   echo .ds head-str "${str#"${str%?}"}"




reply via email to

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