help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to [write sequentially numbered lines]


From: Decebal
Subject: Re: How to [write sequentially numbered lines]
Date: Sat, 10 Oct 2009 14:20:26 -0700 (PDT)
User-agent: G2/1.0

On Oct 10, 10:55 pm, Vassil Nikolov <vniko...@pobox.com> wrote:
> >       local i
> >       local length=${#1}
> >       for i in $(seq ${1}) ; do
> >         printf "       Regel %${length}d voor de test\n" ${i}
> >       done  >${2}
>
>   translates to
>
>     emacs -Q -batch -eval '
>       (dotimes (i '"${1}"')
>         (princ (format "       Regel %'"${#1}"'d voor de test\n" (1+ i))))
>     ' > "${2}"

That works like a charm. Now it takes 19 seconds. More as 3 times as
fast as my version and more as 15 times as fast as the Bash version.

Thanks.


reply via email to

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