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

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



2019-08-08 14:30:53 -0700, Bart Schaefer:
> On Thu, Aug 8, 2019 at 1:18 PM TJ Luoma <luomat@xxxxxxxxx> 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



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