From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5956 invoked by alias); 18 Sep 2016 06:18:36 -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: 21942 Received: (qmail 8921 invoked from network); 18 Sep 2016 06:18:36 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f174.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(209.85.216.174):SA:0(0.0/5.0):. Processed in 0.480749 secs); 18 Sep 2016 06:18:36 -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.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: sgniazdowski@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 209.85.216.174 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0gOx4slRAZbjH2ZyAOVRW685beaYkgO5zICaGLYpeZI=; b=GwXLL2xlAGVJlR6VSJ+my84bGrI+I0HaOjwpFWXagdfPtegVZtIIAHi6vrV9/Gyupm V7FziJauDgPh3QKK2PxJ+HL1BGuxmdb7CaTLKSKwtSNIjsvtjOF7OFzkkgB+7cK/jg9Y OFekj1KpPT2uJ+pMCcEZS+HGN9nnzAoUYvcmpsMZzlOSm22srFYoj6SruchFfY4yHUT5 JhjY+kPhouGOu30pAcXtfW2RJIOwYuPS7+h882uxefgJhjqZ6oYsakAOAbqx5yPfY9hi +1KNKb30BhHPDfi15kOhUeqX4L6zxeUfWmW5juz/hhWCni/zG435Do8fztq4ZhoIB3u0 BCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0gOx4slRAZbjH2ZyAOVRW685beaYkgO5zICaGLYpeZI=; b=ku5OIZk+OguXhZSfTSlj4TtYosheTStcu9nWddW15WeGjKVNzZ2YrT2hJuL24VliLV KHP577ziTJT9aPsNIv6gU++k08o6o1c6T1BF+QE/L+DVYKcm99sMvvfqSgPfRCVYLxnP Td8VJcIQdbBy8gvdEPFAwVm0J1G/38SNKCSdtKQYHrN/SJ94byFwGJAj0pRqQPUNFgZj IAQBWpTzD2owvi10Lw+NXgREXFLUp7PuKuzw8x6ZPP4lOlpPIBl6yP+0DwJqFZCbdLwh nZGU9jPUz0O089BXoYeTYSgmxYwm5iKUdlrhYov8WhzxbNgh6mAY6f7bWn1LRKpXcnhJ z8Zg== X-Gm-Message-State: AE9vXwPKI2pt8yLl1cRap9vjNgF3A6tmV8CejxtktTouCi78LfX3f7xttYKhFo1gptSqLipwPPd9u5nN8/3nlA== X-Received: by 10.237.36.187 with SMTP id t56mr23921888qtc.125.1474175946203; Sat, 17 Sep 2016 22:19:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160917155140.ZM30382@torch.brasslantern.com> References: <160917155140.ZM30382@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Sun, 18 Sep 2016 07:18:45 +0200 Message-ID: Subject: Re: Any neat trick to convert print -rl -- **/** into a tree? To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 18 September 2016 at 00:51, Bart Schaefer wrote: > On Sep 17, 5:54pm, Sebastian Gniazdowski wrote: > } Subject: Any neat trick to convert print -rl -- **/** into a tree? > } > } Hello, > } I'm blank at this but seeing wc -c > 60 various surprising Zsh > } expansions I suspect that it can be done: converting **/** > > Do you intend that second ** to be interpreted GLOB_STAR_SHORT, or > is that a typo? */** didn't have expected effect so I went to **/**, didn't thought about **/* :| > } into a tree, i.e. into output that looks like e.g. output of tree > } command > > It's difficult if not impossible to do this *during* the glob pass, > because the sorting ends up confused, but if you capture the result > in a variable: > > () { > emulate -L zsh -o extendedglob > local x=(**/*) > print -l ${x//([^\/]##\/)/|- } > } > > Refine the replacement as desired. Thanks! Best regards, Sebastian Gniazdowski