unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Decebal <cldwesterhof@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to [write sequentially numbered lines]
Date: Sat, 10 Oct 2009 14:20:26 -0700 (PDT)	[thread overview]
Message-ID: <664b7f18-c3e3-41a3-af53-de58a83ed776@z24g2000yqb.googlegroups.com> (raw)
In-Reply-To: snzd44v3r5o.fsf@luna.vassil.nikolov.name

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	other threads:[~2009-10-10 21:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-10 18:33 How to Decebal
2009-10-10 20:06 ` Andreas Röhler
2009-10-10 20:55 ` How to [write sequentially numbered lines] Vassil Nikolov
2009-10-10 21:20   ` Decebal [this message]
     [not found] ` <mailman.8511.1255205222.2239.help-gnu-emacs@gnu.org>
2009-10-10 20:57   ` How to Decebal
2009-10-11  1:41     ` Decebal
2009-10-11  8:11       ` Andreas Röhler
     [not found]       ` <mailman.8527.1255248737.2239.help-gnu-emacs@gnu.org>
2009-10-11 16:20         ` Decebal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=664b7f18-c3e3-41a3-af53-de58a83ed776@z24g2000yqb.googlegroups.com \
    --to=cldwesterhof@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).