Contextualist / glare

gracefully download (latest) releases from GitHub
76 stars 20 forks source link

使用正则时不能获取到正确的文件名 #3

Closed Mosney closed 4 years ago

Mosney commented 4 years ago

例如:curl -fLO https://glare.now.sh/pymumu/smartdns/^luci-app-smartdns.*\.ipk$ 保存的文件名就是 ^luci-app-smartdns.*.ipk$

curl -O 指定的remote-name 被正则表达式取代了,不知有没有方法避免。

Contextualist commented 4 years ago

curl 有提供对应的选项,取决于你的需求,有两种做法:

  1. -J, --remote-header-name 使用原文件名 例 curl -LOJ https://glare.now.sh/pymumu/smartdns/^luci-app-smartdns.*\.ipk$

  2. -o, --output <file> 指定一个文件名 例 curl -L -o smartdns.ipk https://glare.now.sh/pymumu/smartdns/^luci-app-smartdns.*\.ipk$

Mosney commented 4 years ago

是的,目前在用-o控制保存文件名,感谢回复。