Sujet : Watch Out For Globbing
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shellDate : 26. Aug 2024, 23:31:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vaivom$2kpjl$1@dont-email.me>
User-Agent : Pan/0.160 (Toresk; )
People who use commands across the network often don’t realize that
any globbing of filespecs happens on the local machine, not the remote
one. Example from
<
https://www.zdnet.com/article/3-linux-commands-i-use-for-downloading-files-and-how-theyre-different/>:
curl
http://www.example.com/file[1-5].zip
Now that will probably work, because most people won’t have a
subdirectory called “http:”, with another directory in that called
“
www.example.com”, with, say, a single item in that named “file1.zip”.
Because if you did, you would find that the above command only brought
back the single item with that name.
The right thing to do, of course, when passing specs to the remote end
that look like globs, is to quote them.