From: Christian Weisgerber Subject: Re: regress/tog: enable in sha256 mode To: gameoftrees@openbsd.org Date: Wed, 7 Aug 2024 12:45:41 +0200 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