From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15451 invoked from network); 23 Oct 2021 19:27:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Oct 2021 19:27:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1635017261; b=HacJhflnLxuMz3rOKzYs6p3LSuqmDZOt7MB+xQvGcwPaGR8dO7PLl/Zz6NNSQR7MlUuLCR0kfo Syojwd6ORMMSX4xv876nclJaAOprNGH7mA27Advfgdvb8AE+fazO5YHCJn4X3xJl2V6neSVQ43 6dKxE6xDqH4G29RS5/QjoyQcioYgd26hh0JD3qdDpmIpP+l7NgWqxjEyow1XFn7IErT+8Zuzuu vS8l4kgrzcLliX6NcOic58qt5rjVLbw2DrrbemIo2jiN+QBNhtBDBrcy+eM5v6/wCfvAGkH9IK 2DDc2bdmPv31lVZz24RnVq38qeVv2BYf7FDk+W+KOtWI7Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f175.google.com) smtp.remote-ip=209.85.219.175; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1635017261; bh=sZXIh+2pOgBPWFzPA7VTF0Jz8Tsj5Wli3Q+nZV7vUjE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=DQZNJ6BGubkROBaXsFGbG/jSR363yBzWWJvhyUEvaniDwdtkFvgMGfi52PKo6kfvyMmSluDzTm 5diIrCdScgj5UStCchHanVmOj3uYUAj98LXmCA6DPRdMOR7pE716wUbH9qR8yBANjaAvfzK+7Z 8A28qLe7dTKBYR0d+yd7VaDvADt5NKwkVqORk51hWoiLxG8aw3y8kuGyEmbd3OuEYdt9YAxGr/ 0/lHYM/mwkVBMPYIjJIfUtAZmh4jEy/zt6yj2/LjF0nJIvVEydKZymGvVwtzS3THX094wwAbRi CjdzfRhsdxqFh7uwBpAqPRCQwz1FfsynpmrGm/azpgAdmQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MMnVS9ds2AuKx3vCL82hlMIG7IqtmPOEzENvYrFeYSA=; b=bu7qgUZg2mRsKNLSwtoExJe/Ql Or+4kyc0CJEsGTC2N4q/dLbkJbqX776hc+IZueko/E/b6shOg9J+HUmjHwHW62TcR6xB5+yrBIe0t k9Y2jGCM0Gtoailmk79RvUQSa8kstr6kN4d3XEvd8Y9PHaWnUvC8yAZrs6tlSHTQQjf3EkKdDdQ68 ODUv95QrD/3vL9+PpWnZYzf7xQSYOuCfIbq5KA+dqpnY3zTE6I8rzV65K76UXMT27+iSgOnTDO7Pf +kZF5qXt01Gh0qOiwDbnJIxzOnAt/QiVPXmaXogmh+0X31f+k5SVE87rBvMag7PoxT+mjLdDluFHV EaJQPiAA==; Received: from authenticated user by zero.zsh.org with local id 1meMg8-000BfN-BJ; Sat, 23 Oct 2021 19:27:40 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f175.google.com) smtp.remote-ip=209.85.219.175; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f175.google.com ([209.85.219.175]:33414) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1meMfP-000AyB-Er; Sat, 23 Oct 2021 19:26:55 +0000 Received: by mail-yb1-f175.google.com with SMTP id v7so15086180ybq.0 for ; Sat, 23 Oct 2021 12:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MMnVS9ds2AuKx3vCL82hlMIG7IqtmPOEzENvYrFeYSA=; b=i1JasblThJTvMHiY1XKuBU7p2fhBrkpffjPqau1va7bmL1v3saOtr500sPa9ALZmlJ jSsnDhB+YQgNxXGhYcYzNFVOmarhRu/hcKULFklYRE99ory1/i9+eDQiEqdQpjmsHlP8 LbmhI0Q13FTNhJOAvfQGM5GpmnrcRwozLpAt4R843srvMclDrhvLFJwM4EjG20sP7GvC NDOM6vb6WysWxnSZ+ha70ds9rNBQT+BJH88zvPHUoEhr90fnGXVgL/+05fX/DluKjsUC L1+dQ3YH/r1Ss0kQkShahhJBu9l5ZXr3BcFnqlSS/ZtA1uFYLh6CusZWR4UTNjzLMp5k tFYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MMnVS9ds2AuKx3vCL82hlMIG7IqtmPOEzENvYrFeYSA=; b=J4qRVf3ZUp2DRAq0cRcN93mkQucsjT5r7WRRKtOGKTuG1oEaV9LqguTJGNlX1p0Kst NUmkh5xrwHwI7iT6AIJ6KPJGaiaeNn/WXfz6TExbeacJIHo6CiWecC9X/5x7qF1RDYFo 3jWoi500PGxV5kJsG7IjYTOLO1diys1vix35PB82hx+T9cx4KykvAyARvbiiHIt9phbu tjKkkOlb5wGjt6LEgNzpZ64yBI6+D/MzsX5lMHcCYvJm5PfP/mhoq7AkgT53wT2KHzKR Bzts9kLKNkJzH2a62MRVw9xMAw9QVXD9EiFd633xll2CkK2mfuNbJ+6+fkbOGp8f2eJI 2XJQ== X-Gm-Message-State: AOAM531Z1lyUUpppMVNINv+GB+O4dW3HhrgR3279EG2FmRMWxKp5UFK/ FRaxjADQAqTvP4Ukrs6ITVpp/cL+zuPDSrHIcGjFP75kNPnxvA== X-Google-Smtp-Source: ABdhPJz2i7nIJ05E3RkiHDEuhNiWeZCoh/YoCzWxn72GCJDb4kJFHda0b+jhdbEZAAmTJBZ66pCDSgcElyp0HKYzv+Q= X-Received: by 2002:a05:6902:1241:: with SMTP id t1mr7532589ybu.249.1635017214314; Sat, 23 Oct 2021 12:26:54 -0700 (PDT) MIME-Version: 1.0 References: <20211023164338.GA6763@gmx.de> <095002061dc32afdfb1dcfe51e1171e23e62375d.camel@ntlworld.com> <20211023172445.GA8911@gmx.de> <0b757d10f1a2374d5a84199fbed71314e16fea63.camel@ntlworld.com> In-Reply-To: From: Bart Schaefer Date: Sat, 23 Oct 2021 12:26:43 -0700 Message-ID: Subject: Re: Most Recent File To: Vin Shelton Cc: Peter Stephenson , Zsh-Users List Content-Type: text/plain; charset="UTF-8" X-Seq: 27274 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sat, Oct 23, 2021 at 12:08 PM Vin Shelton wrote: > > print -l -- ${dir}${~2:-*}(-om[1,${1:-1}]) You're still missing any of the (q) options on those expansions. The easiest thing to do here is something like local recent=( ${dir}${~2:-*}(-om[1,${1:-1}]) ) print -lr -- ${(@q-)recent} It's important to add the quoting after any globbing but before you print the result. > Do I really have to use an external command (like `printf') to make this work? printf is a zsh builtin, for some years now. But as long as you add quoting and do not use echo, you should be OK.