When to not expand wildcard characters in zsh?

When to not expand wildcard characters in zsh?

For instance, if you want to copy files from a remote site using scp, you don’t want zsh to expand any wildcards locally; you want that wildcard passed to scp for files on the remote end to match, so instead of: $ scp hades:~/tmp/* .

What’s the difference between zsh and SCP wildcard?

The shell doesn’t know what scp is, or that you’re trying to match remote files. The difference between bash and zsh is their default behavior when it comes to failed globbing. In bash, if a glob doesn’t match anything, it passes the original glob pattern as an argument. In zsh it throws an error instead.

How to glob wildcard characters in the Z shell?

Vincent Danen explains globbing with wildcard characters, and how using globbing in the z shell (zsh) yields powerful results. Globbing is a way of expanding wildcard characters in a non-specific file name into a set of specific file names. Shells use globbing all the time. For instance: When you enter the above, you’re using a glob: foo*.

Why is SCP wildcard not working in Bash?

One strange thing, when I try to scp with a * wildcard, it does not work, and I have to drop into bash. The second command below works fine. Any ideas on why this would be and how to fix it?

When to use Extended Globbing characters in zsh?

If you do decide to use extended globbing, be aware of special characters in file names and the need to quote them. For instance, if you want to copy files from a remote site using scp, you don’t want zsh to expand any wildcards locally; you want that wildcard passed to scp for files on the remote end to match, so instead of:

Which is the wildcard for the ls command?

What the shell is doing, however, is interpreting that wildcard character (*) and then passing the actual files to list to the ls command; so in this instance, the command that is actually being used is ls foo1 foo2. Some standard wildcards that are often used include: