From: Marc Chantreux <marc.chantreux@ulpmm.u-strasbg.fr>
To: Dominik Vogt <dominik.vogt@gmx.de>
Cc: zsh-users <zsh-users@sunsite.dk>
Subject: Re: searching upwards from cwd
Date: Mon, 19 Jun 2006 11:13:28 +0200 [thread overview]
Message-ID: <20060619091328.GA1672@ulpmm.u-strasbg.fr> (raw)
In-Reply-To: <20060619081505.151910@gmx.net>
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
next prev parent reply other threads:[~2006-06-19 9:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-19 8:15 Dominik Vogt
2006-06-19 9:13 ` Marc Chantreux [this message]
2006-06-19 21:03 ` Dominik Vogt
2006-06-20 18:28 ` Dominik Vogt
2006-06-21 1:53 ` Bart Schaefer
2006-06-19 16:11 ` Bart Schaefer
2006-06-20 5:32 ` Sami Samhuri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060619091328.GA1672@ulpmm.u-strasbg.fr \
--to=marc.chantreux@ulpmm.u-strasbg.fr \
--cc=dominik.vogt@gmx.de \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).