unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Loops and scripting in eshell (was: Inject some eshell features into shell?)
Date: Sun, 19 Oct 2003 14:31:27 +0200	[thread overview]
Message-ID: <usmlpz9wg.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: 86fzhuqome.fsf@slowfox.dyndns.org

Kai Grossjohann <kai.grossjohann@gmx.net> writes:

> Even though I now know how to do for loops in eshell, I was wondering
> if the following idea might be fun to play with.  Maybe someone has
> already done this and would like to share?
[...]

Loops are the one feature that I am missing in eshell. But rather than
adding the features I like to M-x shell, I'd prefer to enhance
eshell. [For purely religious reasons. I am very fond of eshell and,
moreover, I believe that the gods of editing will reward me for using
a shell that is implemented in Elisp.]

I sometimes use something like this:

(loop for f in (directory-files "." nil "\\w") do (rename-file f (concat f "x")))

on the eshell command line.

But for the simple stuff I need, I'd prefer the sh syntax:

for i in `ls` do ...

I know how to write a simple interpreter, but unfortunately I am not
familiar with eshell's internals. And I am actually a dummy as far as
shell scripting is concerned (I tend to use Elisp for
everything). And I don't want to spend much time on it right now.

So my questions are:

1. Is it the Right Way to get this by `defun'ing a function
   `eshell/for' which does the necessary parsing? The backquote stuff
   would probably be a problem, but I am not sure whether eshell
   actually provides a way to deal with it. Maybe I could take care
   of it myself. Thoughts?

2. Where can I get (comprehensive) documentation for the sh (bourne?)
   command syntax? I think, if it is feasible, I could as well make
   it decent enough to be worth a patch sent to the eshell
   maintainer.

    Oliver
-- 
28 Vendémiaire an 212 de la Révolution
Liberté, Egalité, Fraternité!

  parent reply	other threads:[~2003-10-19 12:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-15 19:36 Inject some eshell features into shell? Kai Grossjohann
2003-10-15 21:07 ` Stefan Monnier
2003-10-17 19:31 ` Kevin Rodgers
2003-10-17 22:44   ` Kevin Rodgers
2003-10-19 10:56     ` Kai Grossjohann
     [not found]     ` <mailman.1974.1066561040.21628.help-gnu-emacs@gnu.org>
2003-10-20 16:55       ` Kevin Rodgers
2003-10-19 12:31 ` Oliver Scholz [this message]
2003-10-19 15:06   ` Loops and scripting in eshell Kai Grossjohann
     [not found]   ` <mailman.1980.1066576051.21628.help-gnu-emacs@gnu.org>
2003-10-19 20:04     ` Oliver Scholz
2003-10-19 20:15       ` Oliver Scholz
2003-10-19 20:45         ` David Kastrup
2003-10-20 21:27           ` Kai Grossjohann
2003-10-20 23:44             ` Oliver Scholz
2003-10-21  9:05               ` David Kastrup
2003-10-21 16:05                 ` Kai Grossjohann
2003-10-20 19:48   ` Reiner Steib
2003-10-21  8:55     ` Oliver Scholz
2003-10-22 10:55 ` Inject some eshell features into shell? Matthias Meulien

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=usmlpz9wg.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    /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).