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

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

Re: Loops and scripting in eshell


From: Oliver Scholz
Subject: Re: Loops and scripting in eshell
Date: Tue, 21 Oct 2003 01:44:15 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

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

> David Kastrup <dak@gnu.org> writes:
>
>> for f in ${ls -1} { echo $f; }
>
> Hm.  The fact that the -1 is needed hints at some potential problem.
> In the shell, ls behaves differently.  (The -1 is not needed there.)
> So maybe some other programs break when used in a similar way?
>
> (I guess the difference has to do with isatty(3).  No idea how
> difficult would it be for eshell to do this right.)
>
> What do people think?
[...]

I don't know about the isatty issue. I don't know much about the
underlying lower operating system level. But I'd like to note, that it
seems to work in *some* directories, but not in others:

[lisp] $ for f in ${ls} {echo $f}
2cyr.txt                draw.el           iso646-de.el         single-frame.el

*much more output snipped*

[lisp] $ mkdir test
[lisp] $ cd test
[test] $ touch alpha beta gamma delta
[test] $ for f in ${ls} {echo $f}
Wrong type argument: listp, #("alpha  beta  delta  gamma" 0 25 (escaped t))
[test] $ for f in ${ls -l} {echo $f}
total 0
usage: echo [-n] [object]

    -n                   terminate with a newline
    -h, --help           output this help screen


Does anybody know offhand where in the eshell code `for' is implemented?

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


reply via email to

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