zsh-users
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane@chazelas.org>
To: "Mark J. Reed" <markjreed@gmail.com>
Cc: Ray Andrews <rayandrews@eastlink.ca>, Zsh Users <zsh-users@zsh.org>
Subject: Re: unshift
Date: Mon, 01 Apr 2024 17:03:07 +0100	[thread overview]
Message-ID: <109eb9e5d2c3d059fa7da10d0bc6840f@chazelas.org> (raw)
In-Reply-To: <CAA=-s3xvS7d5hv4tqwQ7_kXnWj58+X+rHdLfy_WK_g+_VRJTLQ@mail.gmail.com>

On 2024-04-01 14:54, Mark J. Reed wrote:
> I haven't read your whole message yet, but to unshift a new value in
> front of the positional params, all you have to do is this:
> 
>     set -- "$new" "$@"
> 
> And now $1 is "$new", $2 is whatever $1 used to be, and so on.
[...]

Or

argv[1,0]=$new

-- 
Stephane


  parent reply	other threads:[~2024-04-01 16:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 13:52 unshift Ray Andrews
2024-04-01 13:54 ` unshift Mark J. Reed
2024-04-01 14:00   ` unshift Mark J. Reed
2024-04-01 14:23   ` unshift Ray Andrews
2024-04-01 16:03   ` Stephane Chazelas [this message]
2024-04-01 14:38 ` unshift Roman Perepelitsa
2024-04-01 16:11   ` unshift Ray Andrews
2024-04-01 16:20     ` unshift Roman Perepelitsa
2024-04-01 16:40       ` unshift Ray Andrews
2024-04-01 19:41         ` unshift Bart Schaefer
2024-04-01 22:52           ` unshift Ray Andrews
2024-04-01 16:03 ` unshift Bart Schaefer
2024-04-01 16:30   ` unshift Ray Andrews
2024-04-02 12:41 ` unshift Dennis Eriksen
2024-04-02 14:01   ` unshift Ray Andrews
2024-04-02 19:59     ` unshift Roman Perepelitsa
2024-04-02 20:24       ` unshift Ray Andrews

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=109eb9e5d2c3d059fa7da10d0bc6840f@chazelas.org \
    --to=stephane@chazelas.org \
    --cc=markjreed@gmail.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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).