zsh-users
 help / color / mirror / code / Atom feed
* alias -s with background
@ 2013-06-26  7:50 Ivan Zanolla
  2013-06-26  8:49 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Zanolla @ 2013-06-26  7:50 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

I want start a program with alias -s. But if I wrote

alias -s pdf = evince &

don't work. Why?

-- 
Ivan Zanolla
http://about.me/ivanzanolla

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: alias -s with background
  2013-06-26  7:50 alias -s with background Ivan Zanolla
@ 2013-06-26  8:49 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2013-06-26  8:49 UTC (permalink / raw)
  To: zsh-users

On Wed, 26 Jun 2013 09:50:20 +0200
Ivan Zanolla <ivan.zanolla@gmail.com> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-26  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-26  7:50 alias -s with background Ivan Zanolla
2013-06-26  8:49 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).