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

Re: searching upwards from cwd



Hi Dominik,

le 19/06/2006,
Dominik Vogt nous écrivait :
> 
> I'd like to be able to open addresses.txt in a single command without knowing
> about the working directory.  At the moment, the command depends on cwd:
> 
>   work/  =>  less addresses.txt
>   work/cvs/  =>  less ../addresses.txt
>   work/cvs/projectx/  =>  less ../../addresses.txt
>   work/cvs/projectx/src/  =>  less ../../../addresses.txt

is this enought ? 

from () {
        local base=${PWD%/$1/*}/$1
        shift
        print -l $base/${~^*}
}

less $( from works '**/adresses.txt' )

regards



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