zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.dk
Subject: Re: pop - is there a more elegant solution
Date: Thu, 28 Jun 2001 10:04:15 +0200 (MET DST)	[thread overview]
Message-ID: <200106280804.KAA31411@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <200106280801.KAA63855@numa1.igpm.rwth-aachen.de>

jarausch@igpm.rwth-aachen.dejarausch@igpm.rwth-aachen.de wrote:

> 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,

Not much less cryptic:

  last="$argv[-1]"
  argv[-1]=()


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


  reply	other threads:[~2001-06-28  8:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-28  8:01 jarausch
2001-06-28  8:04 ` Sven Wischnowsky [this message]
2001-06-28  8:23 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200106280804.KAA31411@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).