Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
pop - is there a more elegant solution
- X-seq: zsh-users 3966
- From: jarausch@xxxxxxxxxxxxxxxxxxx
- To: zsh-users@xxxxxxxxxx
- Subject: pop - is there a more elegant solution
- Date: Thu, 28 Jun 2001 10:01:48 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: jarausch@xxxxxxxxxxxxxxxxxxx
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