
在 Windows 上,在 git bash 中(但我認為也在系統控制台中)
為什麼curl
忽略我所有禁用通配符和擴展星號的嘗試?
$ GLOBIGNORE="*"; set -f; curl --noproxy "*" "http://www.google.com"
curl: (6) Could not resolve host: .gitignore
雖然這工作正常:
$ FOO="Abc *"
$ set +f;echo $FOO
Abc .classpath .gitignore .project .settings pom.xml src target
$ set -f;echo $FOO
Abc *
答案1
curl 對 GLOBIGNORE 不友善。
但是,我想問一下,你的命令到底想達到什麼目的呢curl
?
如果您嘗試使用星號來獲取遠端目錄(例如curl "http://www.example.com/*"
)下的所有匹配文件,那麼無論如何這是行不通的。curl
無法列出遠端目錄下的檔案或使網頁伺服器擴展星號。
如果星號用於--noproxy
參數,您可以使用替代方法:
curl --noproxy `ls *` "http://www.google.com"
這將在 後列出當前目錄中的文件/資料夾--noproxy
,但以點開頭的文件/資料夾除外。