Re: [PATCH] xdiff: improve trimming preprocessing

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

 



Am 07.03.2018 um 10:36 schrieb Eric Sunshine:
> On Tue, Mar 6, 2018 at 6:05 PM, Jun Wu <quark@xxxxxx> wrote:
>> Excerpts from Eric Sunshine's message of 2018-03-06 14:23:46 -0500:
>>> On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu <quark@xxxxxx> wrote:
>>>> +  printf "x%.0s" {1..934} >>d # pad common suffix to 1024 bytes
>>>
>>> The expression {x..y} is not portable to non-POSIX shells.
>>
>> Is there a recommended way to generate a repetitive string?
>> Maybe `seq 1000 | sed 's/.*/x/'` ?
> 
> That seems reasonable, although you'd want to use the test suite's
> more portable test_seq rather than seq.

You could also use Perl's repetition operator (x):

	perl -e "print \"x\" x 934" >>d

It is a single command (only one fork()/exec()), simple, produces no
extra newline characters and it's already used e.g. in
t5300-pack-object.sh.

René



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux