Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: alias -s with background
- X-seq: zsh-users 17835
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: alias -s with background
- Date: Wed, 26 Jun 2013 09:49:22 +0100
- In-reply-to: <CALfoNRwGYNc98+-7bv2GrCDvXC0v39hEook_K=Lc1GZ9Nr3bKg@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>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CALfoNRwGYNc98+-7bv2GrCDvXC0v39hEook_K=Lc1GZ9Nr3bKg@mail.gmail.com>
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