zsh-users
 help / color / mirror / code / Atom feed
* turn off globbing sometimes
@ 2007-06-25 14:34 fREW
  2007-06-25 14:38 ` Clint Adams
  0 siblings, 1 reply; 7+ messages in thread
From: fREW @ 2007-06-25 14:34 UTC (permalink / raw)
  To: Zsh users list

Is there a way that I can turn off globing for a certain command so
that I won't have to quote stars and whatnot?

-- 
-fREW


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

* Re: turn off globbing sometimes
  2007-06-25 14:34 turn off globbing sometimes fREW
@ 2007-06-25 14:38 ` Clint Adams
  2007-06-25 14:49   ` fREW
  0 siblings, 1 reply; 7+ messages in thread
From: Clint Adams @ 2007-06-25 14:38 UTC (permalink / raw)
  To: fREW; +Cc: Zsh users list

> Is there a way that I can turn off globing for a certain command so
> that I won't have to quote stars and whatnot?

Search the documentation for 'noglob'.


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

* Re: turn off globbing sometimes
  2007-06-25 14:38 ` Clint Adams
@ 2007-06-25 14:49   ` fREW
       [not found]     ` <2d460de70706260927p45718db7gb0089fc2a26e3e7a@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: fREW @ 2007-06-25 14:49 UTC (permalink / raw)
  To: fREW, Zsh users list

Awesome, thanks!

If anyone else wants to do this, what I did was instead of typing

noglob command *(stuff)

I just aliased the command to include noglob, like so:

alias command="noglob command"

-- 
-fREW


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

* Re: turn off globbing sometimes
       [not found]     ` <2d460de70706260927p45718db7gb0089fc2a26e3e7a@mail.gmail.com>
@ 2007-06-26 16:36       ` fREW
  2007-06-26 23:56         ` Phil Pennock
  0 siblings, 1 reply; 7+ messages in thread
From: fREW @ 2007-06-26 16:36 UTC (permalink / raw)
  To: Zsh users list

What you could do is have two commands, one being an alias to
noglob scp
and the other being vanilla scp
So like:

alias pcp='noglob scp'

pcp remote:foo/* .
scp * remote:foo/

Just a thought.

On 6/26/07, Richard Hartmann <richih.mailinglist@gmail.com> wrote:
>
>
> > alias command="noglob command"
>
> How could I turn globbing off for the _remote_ part of scp?
>
> I.e.
> scp remote:foo/* .
> should not expand, while
> scp * remote:foo/
> should expand normally. Any ideas?
>
>
> Richard


-- 
-fREW


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

* Re: turn off globbing sometimes
  2007-06-26 16:36       ` fREW
@ 2007-06-26 23:56         ` Phil Pennock
  2007-06-27  9:27           ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Phil Pennock @ 2007-06-26 23:56 UTC (permalink / raw)
  To: Zsh users list

>  On 6/26/07, Richard Hartmann <richih.mailinglist@gmail.com> wrote:
> >
> >
> > > alias command="noglob command"
> >
> > How could I turn globbing off for the _remote_ part of scp?
> >
> > I.e.
> > scp remote:foo/* .
> > should not expand, while
> > scp * remote:foo/
> > should expand normally. Any ideas?


alias scp='noglob scp_wrap'
function scp_wrap {
	local -a args
	local i
	for i in "$@"; do case $i in
		(*:*) args+=($i) ;;
		(*) args+=(${~i}) ;;
	esac; done
	command scp "${(@)args}"
}

There's probably a way to inline the ~ GLOB_SUBST enabling only on
elements of an array matching a pattern, whilst leaving the array
element ordering unmutated.

Regards,
-Phil


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

* Re: turn off globbing sometimes
  2007-06-26 23:56         ` Phil Pennock
@ 2007-06-27  9:27           ` Peter Stephenson
  2007-06-27 14:06             ` Wayne Davison
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2007-06-27  9:27 UTC (permalink / raw)
  To: Zsh users list

> On 6/26/07, Richard Hartmann <richih.mailinglist@gmail.com> wrote:
>> How could I turn globbing off for the _remote_ part of scp?
>>
>> I.e.
>> scp remote:foo/* .
>> should not expand, while
>> scp * remote:foo/
>> should expand normally. Any ideas?

"setopt nonomatch" is a pretty good approximation to this, unless
you really have files called remote:foo/* on the disk.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


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

* Re: turn off globbing sometimes
  2007-06-27  9:27           ` Peter Stephenson
@ 2007-06-27 14:06             ` Wayne Davison
  0 siblings, 0 replies; 7+ messages in thread
From: Wayne Davison @ 2007-06-27 14:06 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh users list

On Wed, Jun 27, 2007 at 10:27:07AM +0100, Peter Stephenson wrote:
> "setopt nonomatch" is a pretty good approximation to this, unless
> you really have files called remote:foo/* on the disk.

Going that route, you should also make sure that nonull_glob and
nocsh_null_glob are set, otherwise you can lose an arg or get an
error (the latter if csh_null_glob is set and there's only one
wildcard expression).

..wayne..


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

end of thread, other threads:[~2007-06-27 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-25 14:34 turn off globbing sometimes fREW
2007-06-25 14:38 ` Clint Adams
2007-06-25 14:49   ` fREW
     [not found]     ` <2d460de70706260927p45718db7gb0089fc2a26e3e7a@mail.gmail.com>
2007-06-26 16:36       ` fREW
2007-06-26 23:56         ` Phil Pennock
2007-06-27  9:27           ` Peter Stephenson
2007-06-27 14:06             ` Wayne Davison

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).