Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: auto-reflesh $PATH
- X-seq: zsh-users 11234
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: auto-reflesh $PATH
- Date: Sun, 4 Mar 2007 18:46:09 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=NvsLCYoxNPhuaT7wLOofeLDIq81TOIbVYUwObZ5zDZSaDz19Mkiv+Wwzr7oStk7qH+a6rrkd7Hpzt9L4rPoNDDnHudUcqxbsmyVyDEVHegI99JJvm1pEVZjXbaqk6MjQhiQF58+GWePHpFkxE8vGJrFclCXBYvePDQOpsTZ0Op8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ZcMlCygEcWufEXSwKU0AoDWiUkq8ZLhOZFlTbUu9oZoN2GHqm5yXTCo2lZcvOPPgqnmQiS/DN2VVlONjGjKrJiM4m21UD0erxZqFALZ+eb0QXvlGMHJaZy+jF8KAlS94+i2mNQU/m6BqQL6/hTrEQjzB3fuCmX5BdZ6bIra3GSE=
- In-reply-to: <070303160643.ZM6467@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <c12037010703031514h2730c96te5b721188deda41d@xxxxxxxxxxxxxx> <070303160643.ZM6467@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 3/4/07, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
function preexec {
local -a modified_path
modified_path=( ${^path}(Nms${SECONDS}) )
SECONDS=0
if (( $#modified_path ))
then hash -r
fi
}
That won't catch files being renamed within the same directory in $PATH,
but if you have a lot of directories or a lot of commands in the path it
is probably faster than doing a rehash before every command.
I guess it's time someone writes an inotify module. Any takers?
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author