From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a03763fa for ; Thu, 8 Aug 2019 11:51:14 +0000 (UTC) Received: (qmail 8388 invoked by alias); 8 Aug 2019 11:51:08 -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: List-Unsubscribe: X-Seq: 24133 Received: (qmail 21943 invoked by uid 1010); 8 Aug 2019 11:51:07 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25531. spamassassin: 3.4.2. Clear:RC:0(209.85.221.45):SA:0(-2.0/5.0):. Processed in 5.164107 secs); 08 Aug 2019 11:51:07 -0000 X-Envelope-From: stephane.chazelas@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.221.45 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xpwU/o5tQeVoe3fqUaMMtAFAxxIPGp8kk2oV5wkcnRE=; b=Re1jccgUMaTBehNbiKapDtIXy0getPiXOTHokQnbbvCQ5gQDSP/H6NfUklRlXwCj8O scsJwhn/FnwEpxt9tW8gWfAWHbpSZ62WFsdQ1dTDpMn20RrwYip/2W2P7jSXcboX6C5m 7zKE6TwKxWXLmB9DYlz9Iey8nBV7ZbfkPxDUAyxo0LUZqeNFRZBAmZH4dNfk5IU+mOOD IgQZmoWGBj/LfytqlcbxERv0IFdK02uE0owUstzcSrUEVsFMWqxtun/gGteZcHrFuMAN O5wu9yHY/ttM/Uv4X/loS+kl/vk5w4MuCIYixuwJSevJ47FDMzTEpCuVQrgH77Lz//aM C5AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=xpwU/o5tQeVoe3fqUaMMtAFAxxIPGp8kk2oV5wkcnRE=; b=ZTddz1clONBcef6z3skdUjQzVQR4dfcSqB8HSgJebFRRO0rteBMNx6yLAbYNAaVh0Q pvaQS+wUY94cXbK0QviVDA4FRCW28W41xPTs4uLZn0SyAkf7tQ9WYA3y2Na/2/WVlA2h JzI8b/zjap+XiL8mnDnhY8cKGkqPji+4wcJEAhA/oD2bOqmqKNvr1FxVr8iu/ufx9MwN 2lo2+JCELk/msPVgf+TlWX78jza441Cz2b+hMXPvOyOGDrkktZ30Jkx1CDF549WykV8u lSJtiHxRKJbVLkQfF9SHQ9ANOtL3PTr6s1Cw1/IVWFRUjYZKO3E+yuKw8jYk91mqzHJQ hrdA== X-Gm-Message-State: APjAAAVqwBDuD3ioyH7W7TV3b8f5d0MXggI0BpCCVeTMMR0VY5s0/h65 mkyF/F1ZSWnZdX5q4xgPsB7iwpEIWKo= X-Google-Smtp-Source: APXvYqzmeUfL4d+IQ5HSD2n+theyPmPVm0ItgKUg5Jj9yw4Io82A66JpS7lIiQdde2jvxfxm47rdSQ== X-Received: by 2002:a5d:6190:: with SMTP id j16mr17088238wru.49.1565265028393; Thu, 08 Aug 2019 04:50:28 -0700 (PDT) Date: Thu, 8 Aug 2019 12:50:26 +0100 From: Stephane Chazelas To: TJ Luoma Cc: Zsh MailingList Subject: Re: suffix alias where the app has a space in it Message-ID: <20190808115026.ctryk6bsvckxj7cq@chaz.gmail.com> Mail-Followup-To: TJ Luoma , Zsh MailingList References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 2019-08-08 07:14:21 -0400, TJ Luoma: > I'm trying to use suffix aliases, but I ran into one issue I can't > figure out: What do I do when I want to assign "The Unarchiver" as an > app for archives such as .xz > > alias -s xz="the unarchiver" > > But that tries to use 'the' to open 'xz' files. > > Is there a way to encode a space in the app name? > > I tried googling but either the terms are too vague or no one has > written about this before. [...] alias replacement is token replacement before parsing of the syntax. That applies to suffix aliases as well. You can even do something as crazy as: alias -s xz='for cmd (echo "the unarchiver") $cmd' And when you enter: foo.xz that gets replaced with for cmd (echo "the unarchiver") $cmd foo.xz In your case, just do: alias -s "xz='the unarchiver'" -- Stephane