Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: suffix alias where the app has a space in it



On Thu, 2019-08-08 at 07:14 -0400, TJ Luoma wrote:
> 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?

The thing to remember about aliases is they are expanded very early in
the shell processing --- basically, replacement text is just dumped in
as a raw string where it'll be picked up exactly as is.  So simply
adding a backslash works.

alias -s xz='the\ unarchiver'

pws





Messages sorted by: Reverse Date, Date, Thread, Author