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

Re: Alias for a dynamic variable?



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