Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why is this happening in zsh?



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


Messages sorted by: Reverse Date, Date, Thread, Author