all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: counsel-dired-jump error "find: paths must precede expression:"
Date: Fri, 19 Jan 2018 12:07:39 +0200	[thread overview]
Message-ID: <83y3kutb4k.fsf@gnu.org> (raw)
In-Reply-To: <20180119081302.55smxz7fuoon4433@s70206.gridserver.com> (message from John Magolske on Fri, 19 Jan 2018 00:13:02 -0800)

> 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.



      parent reply	other threads:[~2018-01-19 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18  2:39 counsel-dired-jump error "find: paths must precede expression:" John Magolske
2018-01-18  6:46 ` Yuri Khan
2018-01-19  8:13   ` John Magolske
2018-01-19  9:47     ` Robert Pluim
2018-01-19 10:11       ` tomas
2018-01-19 10:07     ` Eli Zaretskii [this message]

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

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

  git send-email \
    --in-reply-to=83y3kutb4k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.