From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8762 invoked by alias); 25 Feb 2017 22:19:53 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22498 Received: (qmail 13047 invoked from network); 25 Feb 2017 22:19:53 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(0.5/5.0):. Processed in 1.057925 secs); 25 Feb 2017 22:19:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=di5J=2G=brasslantern.com=schaefer@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at bounces.park01.gkg.net does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=resent-from:resent-message-id:resent-date:resent-to:from:message-id :date:in-reply-to:comments:references:to:subject:mime-version; bh=PWxQNAMwjB6wjkh0al13FllAy1bohrmPliXZmpD6tKU=; b=EswaYATcl52cCjSwreqOIAa7soTBfXRZon4ySfQuVb3zBxUJ0svSCzI+j9JAEecBfq KK2qHj6bL/a22ijIgF7WQ7iAfkj7B4bdmhzR/6pYqj7rDPDjWzay26qncHQ8N+Cn7Cer lVuw6YqAz1PAiT4O36dEGbkDbuJFoAjXlM9LBxO54BWUAQnlcUrvMwLIyK8XFBIatZaz TFAi4fyA2MjwMg4pQpm+vqm6Rcva4jpP1WLibde9VIDdsP7ltbslAgpPFr6HMamYKLct OCNzQe0qIfWlnJqkUHeuFlT6ctByrPLu0sy7tOh06WqY9+lv6kpeO71GCIlAMBnL5mhw wU9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-message-id:resent-date :resent-to:from:message-id:date:in-reply-to:comments:references:to :subject:mime-version; bh=PWxQNAMwjB6wjkh0al13FllAy1bohrmPliXZmpD6tKU=; b=P1uJgqUHW6EcJLuV0uezwa5Wks09ZXVJWde5u9Td+SiQucFPmfV3InQfw6WahMZqJ1 1TTbKmFJRnKQK1BDZhuzWv4dzQWzj8XEbEVXwOvhgsqztQU2RhUvHVY6bxW5I6XCL0QW oOcFVjvNLP0y3srIJmKZ9akIhH6s2mXaT8cMbP3pJCtbJeu8LjWdwpIBpqyVbprW1afk +osCYnCjCA15rXpemGNL/aR8GvF6HMIK901I6HIAFbjt88iqHkkMyaNW/d+9HMGCKAXg oI0jn5boe61HPyUC/+VWCTjA70ulBbT4pq0oyAj7xaHnM4nW+KLcwUsFySXT7AoZBmFS 6hEg== X-Gm-Message-State: AMke39lI8sFbUYG321IsUA9INuheMIu9GN+PvQNOKRzqlqj0lPXEjVw2Q2s/M122dcumuQ== X-Received: by 10.31.148.71 with SMTP id w68mr3323673vkd.87.1488061164782; Sat, 25 Feb 2017 14:19:24 -0800 (PST) Resent-From: Bart Schaefer Resent-Message-Id: <170225141934.ZM3319@torch.brasslantern.com> Resent-Date: Sat, 25 Feb 2017 14:19:34 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Resent-To: zsh-users@closedmail.org From: Bart Schaefer Message-Id: <170225120927.ZM22787@torch.brasslantern.com> Date: Sat, 25 Feb 2017 12:09:27 -0800 In-Reply-To: Comments: In reply to Ray Andrews "Re: bash conversion trouble." (Feb 25, 11:13am) References: <004ec4f2-3b3a-8907-86a6-4326399783aa@eastlink.ca> <170224204153.ZM19840@torch.brasslantern.com> <6f722b8f-a712-985f-65e8-3b03a5b352c3@eastlink.ca> <170225075521.ZM22115@torch.brasslantern.com> <32f48d32-2b11-045e-5925-8f112783f1e2@eastlink.ca> <170225090218.ZM22334@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: bash conversion trouble. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 25, 11:13am, Ray Andrews wrote: } } Interesting. So bash and ksh went one way an zsh and csh went the } other. Obviously the decision was made in the context of the time, but } I'd have expected zsh to go with bash. The point is that zsh "went" before there were arrays in bash to follow. "I'd have expected gorillas to be the same color as orangutans." } One hears nothing but bad things about csh. Yes, the intent of zsh was to take only the good things from csh and for everything else be like the Bourne shell (which is NOT "like bash", nor is it even "like POSIX" which came even later). Various extensions for bash/ksh compatibility were then added to make it simpler to do exactly the kind of script conversion you're currently working on, and to help people migrating from bash et al. in the same way that the original design was meant to assist people migrating from csh. } Yeah, why not just use natural counting? That array[9] is the tenth } element has always seemed a bit dumb but I'm used to it from C. In C it makes sense because arrays are based on pointer arithmetic so array[0] == *(array+0) == the start of the array. Shells don't have such pointer arithmetic, at least not exposed by default. That's even the reason that $0 == the program name, because in the underlying C the 0 element of the array passed to execve() is the program name.