From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: unshift
Date: Tue, 2 Apr 2024 13:24:03 -0700 [thread overview]
Message-ID: <5ea19f5d-5808-4850-92bd-5e928a5f2096@eastlink.ca> (raw)
In-Reply-To: <CAN=4vMq2dLxk+yR7_UhNi-g1ng-gXKef9_X--m+AuKGEiW-HMw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 914 bytes --]
On 2024-04-02 12:59, Roman Perepelitsa wrote:
> On Tue, Apr 2, 2024 at 4:03 PM Ray Andrews<rayandrews@eastlink.ca> wrote:
>> while [ "$2" ]; do
>> shift
>> if [ a ]; then b; c; continue fi
>> if [ d ]; then e; f; continue fi
>> code-applies-to-all-below; more(of-the-same)
>> if [ g ]; then h; i; continue fi
>> if [ j ]; then k; l; continue fi
>> done
>>
>> ... so elif won't work.
> It'll work with one `else` in the mix.
>
> Roman.
I'm happy with it as it is now, it seems clean. I've always tended to
be a good Protestant and do:
...
shift
...
...
while [ $1 ]
...
... get the shifting done ASAP, but the more I think about it the more I
like:
...
while [ $2 ]
shift
...
... more Catholic ... do it when you need to do it. The function is
quite a bit simpler that way. Cross bridges when I get to them.
[-- Attachment #2: Type: text/html, Size: 1801 bytes --]
prev parent reply other threads:[~2024-04-02 20:24 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 ` unshift Stephane Chazelas
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 ` Ray Andrews [this message]
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=5ea19f5d-5808-4850-92bd-5e928a5f2096@eastlink.ca \
--to=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).