libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Add an XSI replacement for func_split_short_opt.


From: Ralf Wildenhues
Subject: Re: [PATCH] Add an XSI replacement for func_split_short_opt.
Date: Tue, 29 Jun 2010 00:19:50 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hi Eric,

thanks for the suggestion.  I had considered the idea for a second, but
failed to see the nontrivial half.

* Eric Blake wrote on Mon, Jun 28, 2010 at 02:49:40PM CEST:
> tmp=${1#?}
> patt=
> i=2
> while test $i -lt ${#1}; do
>   patt="?$patt"

If the parameter may be expected to be very long (which I don't think it
will be) then
  func_append patt '?'

would be useful here, and even if not, appending rather than prepending
here helps with current bash.

>   i=$((i+1))
> done
> result=${tmp%$patt}

Cheers,
Ralf



reply via email to

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