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

pop - is there a more elegant solution



Hello,

just being curious,
is there a more elegant (less cryptic) solution to

#!/bin/zsh
# get the last parameter and shorten the list
# emulate Perl's pop function
echo $@
last=$[-1]
# shorten the parameter array
set $@[0,$[-1+$#]]
echo $@

Thanks for your opinion,


Helmut Jarausch

-- 
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany



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