1
可能重复:
wget: Unsupported scheme on non-http URL如何通过bash中的FILE URI方案下载文件?
例如:
export URI=file:///myhost/system.log
如何从这个URI下载SYSTEM.LOG文件在bash?
我尝试过使用wget
和curl
,但他们不支持FILE URI方案。
可能重复:
wget: Unsupported scheme on non-http URL如何通过bash中的FILE URI方案下载文件?
例如:
export URI=file:///myhost/system.log
如何从这个URI下载SYSTEM.LOG文件在bash?
我尝试过使用wget
和curl
,但他们不支持FILE URI方案。
试着这样做:
export URI="file:///etc/passwd"
curl -s "$URI" > /tmp/l
cat /tmp/l
如果您需要下载远程文件,你需要使用其他协议(和方案),如:
curl ftp://user:[email protected]:port/path/to/file
或
scp host:/path/to/file file
等...
注意
curl
能够下载文件方案,尽管你说的话。
确定吗? man curl说FILE是一个支持的协议 –
你可以用正则表达式去除前导的“file://” –
问两次同样的问题不会让你试图做的事情成为可能。 –