Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: scp and globbing in zsh
- X-seq: zsh-users 7742
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: scp and globbing in zsh
- Date: Fri, 23 Jul 2004 10:47:20 -0700 (PDT)
- In-reply-to: <23e98abb04072309486560f63e@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <23e98abb04072309486560f63e@xxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Fri, 23 Jul 2004, matt m wrote:
> $ scp someserver:~/tmp/*.txt .
> $ scp *.txt someserver:~/tmp/
>
> I could just put single quotes around the server path to get it to work
> with globbing but after many years of bash I am having trouble getting
> into the habbit of using single quotes with scp
I suspect that you just want "setopt no_nomatch" so that the glob pattern
is left unexpanded when it doesn't find any matching files. (You may have
to "unsetopt null_glob csh_null_glob" as well.) That's the only way I can
think of that this would do as you seem to expect in bash but not in zsh.
If for some reason you want "nomatch" behavior for other commands but not
for scp, you have to play some games of this sort:
glob_scp() {
emulate -L zsh
array args
local a
for a
do
if [[ $a = *:* ]]
then
args=( $args $a ) # args+=($a) if you have zsh 4.2+
else
args=( $args $~a ) # args+=($~a)
fi
done
scp $args
}
alias scp='noglob glob_scp'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author