From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Zsh users list <zsh-users@sunsite.dk>
Subject: Re: turn off globbing sometimes
Date: Tue, 26 Jun 2007 16:56:14 -0700 [thread overview]
Message-ID: <20070626235614.GA70915@redoubt.spodhuis.org> (raw)
In-Reply-To: <fb3648c60706260936v280aed7fpf1099dde571517df@mail.gmail.com>
> 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
next prev parent reply other threads:[~2007-06-26 23:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-25 14:34 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 [this message]
2007-06-27 9:27 ` Peter Stephenson
2007-06-27 14:06 ` Wayne Davison
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=20070626235614.GA70915@redoubt.spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=zsh-users@sunsite.dk \
/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).