Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: turn off globbing sometimes
- X-seq: zsh-users 11595
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: Re: turn off globbing sometimes
- Date: Tue, 26 Jun 2007 16:56:14 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=XQiVUk0zS7pxnzbhksTN4evjiInoF47XQSDT7088Z1ytwVaPDBhHWKQd/RiTVWsmLKhxOt5LEfaQSS8Hg8HKyeQsChANxCjRV4P1Gl1bWpJ4TZwHGoqti4g5U0H6JeckfTktd8BtbAExPluosD+o7sdQKXBZIpl/s2tne6COF40=;
- In-reply-to: <fb3648c60706260936v280aed7fpf1099dde571517df@xxxxxxxxxxxxxx>
- Mail-followup-to: Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <fb3648c60706250734r7402b1bewb43015d19e9c56fe@xxxxxxxxxxxxxx> <20070625143801.GB27030@xxxxxxxxxxx> <fb3648c60706250749o33012e3bse93886f6754e8dd1@xxxxxxxxxxxxxx> <2d460de70706260927p45718db7gb0089fc2a26e3e7a@xxxxxxxxxxxxxx> <fb3648c60706260936v280aed7fpf1099dde571517df@xxxxxxxxxxxxxx>
> On 6/26/07, Richard Hartmann <richih.mailinglist@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author