From mboxrd@z Thu Jan 1 00:00:00 1970 To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: assigning parameters and globbing Date: Wed, 05 Apr 2006 10:24:16 +0100 From: Peter Stephenson Message-ID: Content-Type: text/plain MIME-Version: 1.0 X-Seq: zsh-users 10135 Vincent Lefevre wrote: > What do you suggest to set an environment BLAH to *([-1]) or something > similar (globbing that leads to a single filename -- which may contain > special characters)? You can, if you like, use glob_assign: setopt GLOB_ASSIGN export BLAH BLAH=*([-1]) but I'd probably use an intermediate array. local -a files files=(*) export BLAH=${files[-1]} -- Peter Stephenson 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