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

Re: assigning parameters and globbing



On 2006-04-05 08:00:56 -0700, Bart Schaefer wrote:
>     files=(*) eval 'export BLAH=$files[-1]'

This would perhaps be more efficient:

  files=(*([-1])) eval 'export BLAH=$files'

Or perhaps I could reuse my old setenv function:

setenv() { export "$1=$2" }
setenv BLAH *([-1])

I wonder why there isn't something similar in standard to avoid the "="
in assignments, e.g. a typeset option -e: export -e BLAH *([-1])

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Messages sorted by: Reverse Date, Date, Thread, Author