zsh-users
 help / color / mirror / code / Atom feed
* line noise of the day
@ 2011-09-14 15:56 Mikael Magnusson
  2011-09-14 16:18 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2011-09-14 15:56 UTC (permalink / raw)
  To: Zsh Users

<dmos> anyone know a script/oneliner to find all duplicate/shadowed
commands on $PATH?
<Mikachu> print -l $^commands(e,'() { (( $# > 1 )) && REPLY=$@ }
$^path/$REPLY:t(N)',N)

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: line noise of the day
  2011-09-14 15:56 line noise of the day Mikael Magnusson
@ 2011-09-14 16:18 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2011-09-14 16:18 UTC (permalink / raw)
  To: Zsh Users

On 14 September 2011 17:56, Mikael Magnusson <mikachu@gmail.com> wrote:
> <dmos> anyone know a script/oneliner to find all duplicate/shadowed
> commands on $PATH?
> <Mikachu> print -l $^commands(e,'() { (( $# > 1 )) && REPLY=$@ }
> $^path/$REPLY:t(N)',N)

I should have thought of this, but the above will only work in 4.3.13
and later. This should work with a few more versions (and any
linebreaks are added by gmail, join them with a space).

print -l $^commands(e,'a () { (( $# > 1 )) && REPLY=$@ }; a
$^path/$REPLY:t(N)',N)

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-14 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-14 15:56 line noise of the day Mikael Magnusson
2011-09-14 16:18 ` Mikael Magnusson

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