Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: searching upwards from cwd
- X-seq: zsh-users 10390
- From: Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>
- To: Dominik Vogt <dominik.vogt@xxxxxx>
- Subject: Re: searching upwards from cwd
- Date: Mon, 19 Jun 2006 11:13:28 +0200
- Cc: zsh-users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20060619081505.151910@xxxxxxx>
- Mail-followup-to: Dominik Vogt <dominik.vogt@xxxxxx>, zsh-users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060619081505.151910@xxxxxxx>
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