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

Re: alias -s with background



On Wed, 26 Jun 2013 09:50:20 +0200
Ivan Zanolla <ivan.zanolla@xxxxxxxxx> wrote:
> I want start a program with alias -s. But if I wrote
> 
> alias -s pdf = evince &
> 
> don't work. Why?

That's put the alias command into the background; also, you can't have
spaces around the "=" or they are treated as different aliases.  "alias
-s", like other variants of alias, is limited to putting a new command
at the start of the line.  You need to do it something like this:

  evince_bg() { evince "$@" & }
  alias -s pdf=evince_bg

(See also zsh-mime-setup, documented in the zshcontrib manual, if you
already have MIME information for this in mailcap and mime.types files.)

pws



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