Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

eshell: find: missing argument to `-exec' ?

53 views
Skip to first unread message

Xah Lee

unread,
Sep 11, 2009, 3:59:26 AM9/11/09
to
when running eshell in Windows, i do

c:\Users\xah\web\xxst\make_download_copy>find -name "*el" -exec rm {}
\;
find -name "*el" -exec rm {} \;
find: missing argument to `-exec'

why is it missing argument?

Thanks.

Xah
http://xahlee.org/


Alan Mackenzie

unread,
Sep 11, 2009, 8:23:35 AM9/11/09
to
Hi, Xah,

Xah Lee <xah...@gmail.com> wrote:
> when running eshell in Windows, i do

> c:\Users\xah\web\xxst\make_download_copy>find -name "*el" -exec rm {}
> \;
> find -name "*el" -exec rm {} \;
> find: missing argument to `-exec'

> why is it missing argument?

At a guess, you need to quote the {}, like this:

find -name "*el" -exec rm \{} \;
^

> Thanks.

> Xah

--
Alan Mackenzie (Nuremberg, Germany).

Pascal J. Bourguignon

unread,
Sep 11, 2009, 8:43:53 AM9/11/09
to
Alan Mackenzie <a...@muc.de> writes:

> Hi, Xah,
>
> Xah Lee <xah...@gmail.com> wrote:
>> when running eshell in Windows, i do
>
>> c:\Users\xah\web\xxst\make_download_copy>find -name "*el" -exec rm {}
>> \;
>> find -name "*el" -exec rm {} \;
>> find: missing argument to `-exec'
>
>> why is it missing argument?
>
> At a guess, you need to quote the {}, like this:
>
> find -name "*el" -exec rm \{} \;

find gives this error when it doesn't see the ';' argument.
I know of no shell where {} needs to be escaped or quoted.

eshell seems to have difficulties with backslash escapes on
MS-Windows. Then we could use quotes instead:

find -name "*el" -exec rm {} ';'

--
__Pascal Bourguignon__

Eli Zaretskii

unread,
Sep 11, 2009, 10:57:28 AM9/11/09
to help-gn...@gnu.org
> From: p...@informatimago.com (Pascal J. Bourguignon)
> Date: Fri, 11 Sep 2009 14:43:53 +0200

>
> > At a guess, you need to quote the {}, like this:
> >
> > find -name "*el" -exec rm \{} \;
>
> find gives this error when it doesn't see the ';' argument.
> I know of no shell where {} needs to be escaped or quoted.
>
> eshell seems to have difficulties with backslash escapes on
> MS-Windows. Then we could use quotes instead:
>
> find -name "*el" -exec rm {} ';'

The {} needs to be quoted as well.


Xah Lee

unread,
Sep 11, 2009, 2:45:25 PM9/11/09
to
none of the suggestions seems to work so far.

c:\Users\xah\Documents\vrici\cabdei>find . -name "*sch*" -exce echo \
{} \;
find . -name "*sch*" -exce echo \{} \;
find: unknown predicate `-exce'

c:\Users\xah\Documents\vrici\cabdei>find . -name "*sch*" -exce echo \
{\} \;
find . -name "*sch*" -exce echo \{\} \;
find: unknown predicate `-exce'

c:\Users\xah\Documents\vrici\cabdei>find . -name "*sch*" -exce echo {}
';'
find . -name "*sch*" -exce echo {} ';'
find: unknown predicate `-exce'

c:\Users\xah\Documents\vrici\cabdei>find . -name "*sch*" -exce echo
'{}' ';'
find . -name "*sch*" -exce echo '{}' ';'
find: unknown predicate `-exce'

this appears to be a bug?

Xah
http://xahlee.org/


Xah Lee

unread,
Sep 11, 2009, 2:53:15 PM9/11/09
to

Sorry, i had big typo in the above. This works:

find . -name "*sch*" -exec echo {} ';'

Thanks. Still, this probably should probably be considered a bug. Is
there some technical reason eshell having problems with the \; ?

Xah

Eli Zaretskii

unread,
Sep 12, 2009, 4:27:37 AM9/12/09
to help-gn...@gnu.org
> From: Xah Lee <xah...@gmail.com>
> Date: Fri, 11 Sep 2009 11:53:15 -0700 (PDT)

>
> Sorry, i had big typo in the above. This works:
>
> find . -name "*sch*" -exec echo {} ';'
>
> Thanks. Still, this probably should probably be considered a bug. Is
> there some technical reason eshell having problems with the \; ?

Yes, there is: you cannot have \ be an escape character on Windows
(without some major annoyances), because it serves as a directory
separator.


Xah Lee

unread,
Sep 12, 2009, 1:10:00 PM9/12/09
to

I see. thanks.

Xah

Pascal J. Bourguignon

unread,
Sep 14, 2009, 5:35:24 AM9/14/09
to
Eli Zaretskii <el...@gnu.org> writes:

Not with bash in eshell on unix. Perhaps it's needed specifically on MS-Windows?

--
__Pascal Bourguignon__

0 new messages