[darcs-users] can we get rid of perl requirement in our test suite?
Dan Pascu
dan at ag-projects.com
Fri May 15 00:53:21 UTC 2009
On Thursday 14 May 2009, Salvatore Insalaco wrote:
> On Thu, May 14, 2009 at 6:53 PM, Eric Kow <kowey at darcs.net> wrote:
> > It'd be nice if we could make just one last push to get rid of these.
> > Ideas?
>
> I tried to substitute the 1mb file generation with something like that:
>
> while true; do echo -n "a"; done | head -c 1048000
>
> but it is really really slow :).
That is easy to fix. Just make echo output more chars at a time:
while true; do echo -n "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; done |
head -c 1048000
However there is no point in using that construct, when you can actually
use a much simpler and _much_ faster command to generate your content:
printf "%01048000d" 0 | tr [0] [a]
If you do not care about the char being 'a' and can use a file filled with
'0' instead, just remove the tr command to make it even faster:
printf "%01048000d" 0
--
Dan
More information about the darcs-users
mailing list