Skip to content

scp and rsync unable to glob #2127

@rtsui-harmonicinc

Description

@rtsui-harmonicinc

By default zpresto is aliasing scp and rsync to noglob, but it comes in weird behaviour as follow.

After mangling, I decided to unalias both and now it is working.

Before unaliasing scp, the only way I can copy multiple files with glob is using the prefixed \scp

/tmp
❯ scp '/tmp/*.rb' cdedd-vagrant:/vagrant/
scp: stat local "/tmp/*.rb": No such file or directory

/tmp
❯ which scp
scp: aliased to noglob scp

/tmp
❯ \scp *.rb cdedd-vagrant:/vagrant/
k8s_spec.rb                                                                                                    100% 9823   313.3KB/s   00:00
spec_helper.rb                                                                                                 100%  128     4.0KB/s   00:00

/tmp
❯ scp *.rb cdedd-vagrant:/vagrant/
scp: stat local "*.rb": No such file or directory

❯ which \scp
scp: aliased to noglob scp

After unaliasing scp, I can use both scp and \scp to do file glob

/tmp
> scp '/tmp/*.rb' cdedd-vagrant:/vagrant/
scp: stat local "/tmp/*.rb": No such file or directory

> scp *.rb cdedd-vagrant:/vagrant/
k8s_spec.rb                                                                                                    100% 9823   277.6KB/s   00:00
spec_helper.rb                                                                                                 100%  128     4.0KB/s   00:00

> which \scp
/usr/bin/scp

> \scp *.rb cdedd-vagrant:/vagrant/
k8s_spec.rb                                                                                                    100% 9823   303.1KB/s   00:00
spec_helper.rb                                                                                                 100%  128     1.2KB/s   00:00

zsh version:
zsh --version
zsh 5.9 (arm64-apple-darwin25.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions