From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10477 invoked by alias); 17 Dec 2016 23:16:22 -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: 22228 Received: (qmail 18210 invoked from network); 17 Dec 2016 23:16:22 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f51.google.com 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(74.125.82.51):SA:0(1.0/5.0):. Processed in 0.860431 secs); 17 Dec 2016 23:16:22 -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=1.0 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLYTO, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: linux.tech.guy@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to; bh=0JZBJo1OIJiWcUvpaSvW8LmJCRHNsase9N5InUbLqT0=; b=JojJxKq8rNlthSiBcCanq3BiRKiLvlEFczc+/0hLPsMb1deaoPMg5w7yCfVHwXfkmw N/+GxFbe6CjaAJJdEN2uXSLcndE24/P7eROBqOpwnw/YC1OaDCQB/J24nLBy0jxwySb8 JLyHL0wBuBijIHoDU2Bwxr/E5GeR0ugptvNkuC2Yq/78p+cYAWLTH5Dihoq4Y1mcIUnV 2b192wJuKo9iBD6VW8Wd4Y+WnVBYdlVn6Pbt5/WF6umhjPHKhWxNIeUNtGnaXMi75TSF St0TfVSt7HHwSzObmXFflUxGwmqFOXPa+y2AZfhSRVNxlXUMwe6pSzDFgduSRVuGs9ZG +vzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to; bh=0JZBJo1OIJiWcUvpaSvW8LmJCRHNsase9N5InUbLqT0=; b=JNxt1i7ys8s93wiNso1tsb/1wqMh93XiiAa1pR1DOrH8AQTUTJRg6LSy9tZOR2lz9Y Bivnsbhqqp1g9Afxt1o1Np6JZtA4DaLCzGLYtpV2I2ZjT3SRYo85UdkVRTjQhf4PbNfa uREMv0VPYFyn3OhbtD9uPEydMvBQYx7g09CaVdGTsStLAnmfY7Y7rbj5PXAZ0Hx0w/jw BzGhvvLVdMEQaCh66HxEI+kUqVaOK0QNo3ZGNzXGG5bsDAFzBPYRL4XcHQ4CvX5ZsBmi kBnl3GBcwQOFI8lIEUjoKn8iOysQojllgOKSR++Oa4H/xjE5tVXSVeBmsqqtZ61Vl7o6 Y/Gw== X-Gm-Message-State: AIkVDXJRNgqGnPAEKAGXtVMJIDJvncguXaUyIIWdHlA831SE/zgg484Yd4vEfP2+PazF16ivZkBQ6iA95pyyfQ== X-Received: by 10.28.72.198 with SMTP id v189mr8180047wma.13.1482016573045; Sat, 17 Dec 2016 15:16:13 -0800 (PST) MIME-Version: 1.0 Reply-To: linuxtechguy@gmail.com In-Reply-To: <58540944.3030706@eastlink.ca> References: <58540944.3030706@eastlink.ca> From: Jim Date: Sat, 17 Dec 2016 17:16:12 -0600 Message-ID: Subject: Re: trapped in bash To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a114b32bc6340380543e2df79 --001a114b32bc6340380543e2df79 Content-Type: text/plain; charset=UTF-8 On Fri, Dec 16, 2016 at 9:33 AM, Ray Andrews wrote: > > BTW: > > _array=( ${(f)_variable} ) > _count=$#_array # Count the number of lines. > > Can that be simplified? I don't need the _array, just the _count. Of > course there are any number of utilities to count lines, but I mean the > simplest zsh way, although the above is nicely self-explanatory _count=${#${(f)_variable}} This will remove the need for the variable _array. One caution, if your not already aware, (f) removes blank lines, so they won't show up in the count. Hope this helps, Jim --001a114b32bc6340380543e2df79--