39
15
Using commands such as rsync
and scp
with ZSH
I've run into trouble. Instead of the (normal) behaviour of giving me all matching files, it won't run and returns:
➜ ~ rsync -azP user@server:~/* ~/
zsh: no matches found: user@server:~/*
How can I fix this?
My .zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git brew)
source $ZSH/oh-my-zsh.sh
export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/sbin
Thanks! Never had to do that with
bash
. – Morgan – 2013-04-18T06:36:13.103@Morgan That's weird, actually. Without the quotes, Bash should expand the tilde before
rsync
ever sees it. Could it be that you were just using the same path for the home directory on both servers? – slhck – 2013-04-18T06:52:05.857@slhck No, he's right. zsh has some more options to configure wildcards so this behavior can be changed in the zshrc. – Spack – 2013-04-18T07:30:04.937
I wasn't saying Morgan was wrong. I was just wondering why Bash doesn't expand the tilde before rsync, while Zsh seems to do that? – slhck – 2013-04-18T07:36:00.427
@Spack - you say it could be changes in
.zshrc
: can you elaborate a bit on how to configure this (perhaps edit your answer)? I'm looking for a way to do this without quoting the wildcard path. – sa125 – 2013-04-18T10:28:32.5031@sa125 I've edited my answer. – Spack – 2013-04-18T18:09:20.720
1@slhck:
bash
only expands a tilde when it begins a word, or is the first character following a:
or the first=
in a variable assignment. Otherwise, it is treated literally. – chepner – 2013-04-22T18:08:29.600