* Dude, where is noglob?
@ 2015-08-19 12:31 Marc Chantreux
2015-08-19 13:00 ` Peter Stephenson
2015-08-19 14:56 ` Bart Schaefer
0 siblings, 2 replies; 6+ messages in thread
From: Marc Chantreux @ 2015-08-19 12:31 UTC (permalink / raw)
To: Zsh hackers list
hello guys,
there is something i miss from man zshall:
PRECOMMAND MODIFIERS
noglob Filename generation (globbing) is not performed on any of the
words.
so i tried
alias dude!="noglob dude"
dude () { print "$@" }
dude! where is my car?
but ... :)
zsh: no matches found: car?
it sounds like "oops... i tried it anyway".
regards
--
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
-- Abraham Lincoln
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Dude, where is noglob?
2015-08-19 12:31 Dude, where is noglob? Marc Chantreux
@ 2015-08-19 13:00 ` Peter Stephenson
2015-08-20 13:24 ` Marc Chantreux
2015-08-20 13:26 ` Marc Chantreux
2015-08-19 14:56 ` Bart Schaefer
1 sibling, 2 replies; 6+ messages in thread
From: Peter Stephenson @ 2015-08-19 13:00 UTC (permalink / raw)
To: Zsh hackers list
On Wed, 19 Aug 2015 14:31:38 +0200
Marc Chantreux <khatar@phear.org> wrote:
> alias dude!="noglob dude"
> dude () { print "$@" }
> dude! where is my car?
Do you have !-history enabled? In which case the dude! command works OK
(! not active before a space) but the alias could do anything. Try
alias 'dude!=noglob dude'
pws
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Dude, where is noglob?
2015-08-19 12:31 Dude, where is noglob? Marc Chantreux
2015-08-19 13:00 ` Peter Stephenson
@ 2015-08-19 14:56 ` Bart Schaefer
1 sibling, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2015-08-19 14:56 UTC (permalink / raw)
To: Marc Chantreux, Zsh hackers list
Works For Me:
torch% alias dude!="noglob dude"
torch% dude () { print "$@" }
torch% dude! where is my car?
where is my car?
torch%
Are you sure you haven't accidentally created a function named "noglob"
at some point while experimenting with this?
--
Barton E. Schaefer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Dude, where is noglob?
2015-08-19 13:00 ` Peter Stephenson
@ 2015-08-20 13:24 ` Marc Chantreux
2015-08-20 15:40 ` Bart Schaefer
2015-08-20 13:26 ` Marc Chantreux
1 sibling, 1 reply; 6+ messages in thread
From: Marc Chantreux @ 2015-08-20 13:24 UTC (permalink / raw)
To: Peter Stephenson; +Cc: Zsh hackers list
Thanks Bart and Peter for replying
On Wed, Aug 19, 2015 at 02:00:14PM +0100, Peter Stephenson wrote:
> On Wed, 19 Aug 2015 14:31:38 +0200
> Marc Chantreux <khatar@phear.org> wrote:
> > alias dude!="noglob dude"
> > dude () { print "$@" }
> > dude! where is my car?
>
> Do you have !-history enabled? In which case the dude! command works OK
> (! not active before a space) but the alias could do anything. Try
>
> alias 'dude!=noglob dude'
i have no idea what's enabled there but
alias dude!="noglob dude"
dude () { print "$@" }
dude! where is my car?
alias dude="noglob dude"
dude () { print "$@" }
dude where is my car?
--
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
-- Abraham Lincoln
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Dude, where is noglob?
2015-08-19 13:00 ` Peter Stephenson
2015-08-20 13:24 ` Marc Chantreux
@ 2015-08-20 13:26 ` Marc Chantreux
1 sibling, 0 replies; 6+ messages in thread
From: Marc Chantreux @ 2015-08-20 13:26 UTC (permalink / raw)
To: Peter Stephenson; +Cc: Zsh hackers list
Thanks Bart and Peter for replying
On Wed, Aug 19, 2015 at 02:00:14PM +0100, Peter Stephenson wrote:
> On Wed, 19 Aug 2015 14:31:38 +0200
> Marc Chantreux <khatar@phear.org> wrote:
> > alias dude!="noglob dude"
> > dude () { print "$@" }
> > dude! where is my car?
>
> Do you have !-history enabled? In which case the dude! command works OK
> (! not active before a space) but the alias could do anything. Try
>
> alias 'dude!=noglob dude'
ok: if i remove the !, it works like a charm. thanks you
--
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
-- Abraham Lincoln
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Dude, where is noglob?
2015-08-20 13:24 ` Marc Chantreux
@ 2015-08-20 15:40 ` Bart Schaefer
0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2015-08-20 15:40 UTC (permalink / raw)
To: Zsh hackers list; +Cc: Marc Chantreux
On Aug 20, 3:24pm, Marc Chantreux wrote:
}
} alias dude!="noglob dude"
} dude () { print "$@" }
} dude! where is my car?
}
} alias dude="noglob dude"
} dude () { print "$@" }
} dude where is my car?
Normally that second one doesn't work because all you've done is create
a function named "noglob" which then takes precedence over the modifier.
You need to define the alias AFTER the function. Zsh FAQ #2.1 and #2.3.
torch% alias dude!="noglob dude"
torch% dude () { print "$@" }
torch% dude! where is my car?
where is my car?
torch% alias dude="noglob dude"
torch% dude () { print "$@" }
torch% dude where is my car?
zsh: no matches found: car?
torch% alias
dude='noglob dude'
'dude!'='noglob dude'
run-help=man
which-command=whence
torch% functions
dude () {
print "$@"
}
noglob () {
print "$@"
}
torch%
--
Barton E. Schaefer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-20 15:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19 12:31 Dude, where is noglob? Marc Chantreux
2015-08-19 13:00 ` Peter Stephenson
2015-08-20 13:24 ` Marc Chantreux
2015-08-20 15:40 ` Bart Schaefer
2015-08-20 13:26 ` Marc Chantreux
2015-08-19 14:56 ` Bart Schaefer
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).