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

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

Re: counsel-dired-jump error "find: paths must precede expression:"


From: Eli Zaretskii
Subject: Re: counsel-dired-jump error "find: paths must precede expression:"
Date: Fri, 19 Jan 2018 12:07:39 +0200

> Date: Fri, 19 Jan 2018 00:13:02 -0800
> From: John Magolske <listmail@b79.net>
> 
> > https://github.com/abo-abo/swiper/blob/master/counsel.el#L2183
> > 
> > contains this expression:
> > 
> >     (shell-command-to-string
> >       (concat find-program " * -type d -not -path '*\/.git*'"))
> > 
> > The * in the first argument will be expanded by the shell to a list of
> > all files in the current directory, in unspecified order. If any of
> > them happens to look like a ‘find’ option, ‘find’ will try to
> > interpret it as one, with unintended consequences.
> 
> looking into this further, I found a quoted wildcard resolves the issue:
> 
>     (shell-command-to-string
>      (concat find-program " -path './*' -type d -not -path '*\/.git*'"))

Beware: this uses quoting that will fail on non-Posix hosts.  For
portable code, always use shell-quote-argument instead of literal
quotes and backslash-escapes.



reply via email to

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