From: Dominik Vogt <dominik.vogt@gmx.de>
To: zsh-users <zsh-users@sunsite.dk>
Cc: Dominik Vogt <dominik.vogt@gmx.de>
Subject: Re: searching upwards from cwd
Date: Tue, 20 Jun 2006 20:28:37 +0200 [thread overview]
Message-ID: <20060620182837.GA2609@gmx.de> (raw)
In-Reply-To: <20060619210356.GB2434@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]
On Mon, Jun 19, 2006 at 11:03:57PM +0200, Dominik Vogt wrote:
> On Mon, Jun 19, 2006 at 11:13:28AM +0200, Marc Chantreux wrote:
> > 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' )
>
> Ah, that's not quite what I'm looking for. It's too much to type
> - I could as well try an increasing numer of '../' components and
> hit TAB every time.
Hm, this is close:
less (../)#adr*
But is there any way to prevent the globbing pattern is expanded
to multiple words? I just want the first/shortest match.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt, dominik.vogt@gmx.de
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-06-20 18:32 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
2006-06-19 21:03 ` Dominik Vogt
2006-06-20 18:28 ` Dominik Vogt [this message]
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=20060620182837.GA2609@gmx.de \
--to=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).