"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: regress/tog: enable in sha256 mode
To:
gameoftrees@openbsd.org
Date:
Wed, 7 Aug 2024 12:45:41 +0200

Download raw body.

Thread
Stefan Sperling:

> > +trim()
> > +{
> > +	expr "$2" : "\(.\{$1\}\)"
> > +}
> 
> Seems this returns an empty string if the input is shorter than
> the requested trim amount.

That can easily be changed by specifying a lower bound:

	expr "$2" : "\(.\{1,$1\}\)"

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de