zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: suffix alias where the app has a space in it
Date: Thu, 8 Aug 2019 22:53:00 +0100	[thread overview]
Message-ID: <20190808215300.2e6tls75nt62m7wk@chaz.gmail.com> (raw)
In-Reply-To: <CAH+w=7aShn_9VP18WtpuYSA70zAKR23v+K-JNQqj-4JGpOgUeQ__23215.3090693586$1565299951$gmane$org@mail.gmail.com>

2019-08-08 14:30:53 -0700, Bart Schaefer:
> On Thu, Aug 8, 2019 at 1:18 PM TJ Luoma <luomat@gmail.com> wrote:
> >
> > Related Question: is there a way to set a default command to use for
> > all suffixes, and then make additional aliases for other suffixes?
> 
> Not with alias.  You could try a command-not-found handler.
> 
> > Something like this:
> >
> > alias -s '*'='open'
> 
> What that means is that if you type
> 
> % foo.*
> 
> then "open foo.*" will be executed.  It does NOT mean that the alias
> will be invoked when you type
> 
> % foo.bar
> 
> Aliases do not do pattern matching.
[...]

And anyway, you would probably not want

/etc/init.d/foo start
or
gcc-8.0 -c a.c
or
myscript.pl
or
mkfs.ext4 /dev/sda12

to call "open those-commands" just because the name of the
command contains a dot character.

-- 
Stephane


           reply	other threads:[~2019-08-08 21:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAH+w=7aShn_9VP18WtpuYSA70zAKR23v+K-JNQqj-4JGpOgUeQ__23215.3090693586$1565299951$gmane$org@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190808215300.2e6tls75nt62m7wk@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).