Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: suffix alias where the app has a space in it
- X-seq: zsh-users 24133
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: suffix alias where the app has a space in it
- Date: Thu, 8 Aug 2019 12:50:26 +0100
- Cc: Zsh MailingList <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <CADjGqHv7H6xsYHYwNwD49LEQsHWw4DdzBtpFK=C=umLGDNdZEQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-followup-to: TJ Luoma <luomat@xxxxxxxxx>, Zsh MailingList <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADjGqHv7H6xsYHYwNwD49LEQsHWw4DdzBtpFK=C=umLGDNdZEQ@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author