Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Alias for a dynamic variable?
- X-seq: zsh-users 10192
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Alias for a dynamic variable?
- Date: Thu, 27 Apr 2006 17:45:21 +0100
- In-reply-to: <Xns97B2B2CC4E1Ezzappergmailcom@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns97B2AD9E7A62zzappergmailcom@xxxxxxxxxxx> <EXCHANGE03cWo7Z0xK40000be27@xxxxxxxxxxxxxxxxxx> <Xns97B2B2CC4E1Ezzappergmailcom@xxxxxxxxxxx>
zzapper wrote:
> Peter Stephenson <pws@xxxxxxx> wrote in news:EXCHANGE03cWo7Z0xK40000be27
> @exchange03.csr.com:
>
> > alias -g s='$OLDPWD'
> this works such that I can
> >cd s
> but I cant do
> >cp s/somefile .
You can already use ~- to refer to the relevant directory.
If you want a parameter, you can assign it every time the directory
changes:
chpwd() { O=$OLDPWD }
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author