From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Kyle Partridge <partkyle@gmail.com>
Cc: Nomen Nescio <nobody@dizum.com>, zsh-users@zsh.org
Subject: Re: Why is this happening in zsh?
Date: Thu, 15 Mar 2012 23:28:12 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.01.1203151522480.18133@hp.internal> (raw)
In-Reply-To: <B80FC916-9DF0-47A7-AED2-6C307F389F88@gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 855 bytes --]
On Thu, 15 Mar 2012, Kyle Partridge wrote:
> So I alias these type of commands to use `noglob`. Does this solution make sense?
>
> Ex:
> alias find="noglob find"
Usually, yes. `find` is a bit different (for me at least), since I
often want to do things like:
find ~gems/*3.2.0*(/) -exec grep -l some_method '{}' \;
(Not the best example, but the point is that I often glob to get the
list of directories, and don't want to have to do it using `find`
predicates.)
I've been using this function that PWS gave me¹:
alias find='noglob find'
'find'() {
integer i=${argv[(i)-*]}
command find ${~argv[1,i-1]} "${(@)argv[i,-1]}"
}
The alias turns on `noglob`, but then the function manually globs
every argument prior to the first one that starts with a dash.
--
Best,
Ben
¹: zsh-users 15446 : http://www.zsh.org/mla/users/2010/msg00745.html
prev parent reply other threads:[~2012-03-16 3:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-14 18:59 Anonymous
2012-03-14 19:29 ` Heorhi Valakhanovich
2012-03-14 23:19 ` Damien Thébault
2012-03-14 19:42 ` Stephane Chazelas
2012-03-14 19:49 ` Peter Stephenson
2012-03-15 10:13 ` Nomen Nescio
2012-03-15 18:00 ` Kyle Partridge
2012-03-16 0:11 ` Christoph (Stucki) von Stuckrad
2012-03-16 3:28 ` Benjamin R. Haskell [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=alpine.LNX.2.01.1203151522480.18133@hp.internal \
--to=zsh@benizi.com \
--cc=nobody@dizum.com \
--cc=partkyle@gmail.com \
--cc=zsh-users@zsh.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 public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).