我附上我想要的URL wget
,""
因为它们中的大多数都有空格,花括号等。它通常可以正常工作,但是我无法使该URL正常工作:
wget "http://xxxx/Sankarea - 6 - It`s Because I... Ran Into You (720p-100MB)[Commie][Daylighter].mkv"
它输出
-bash: command substitution: line 1: syntax error near unexpected token `('
-bash: command substitution: line 1: `s Because I... Ran Into You (720p-100MB)[Commie][Daylighter].mkv"
这是什么意思?有解决这个问题的技巧吗?
尝试单引号:
wget 'http://xxxx/Sankarea - 6 - It`s Because I... Ran Into You (720p-100MB)[Commie][Daylighter].mkv'
并且如果您在URL本身中使用单引号,则将URL分成两个字符串,并在单引号中插入反斜杠:'...'\''....'
或使用双引号:'...'"'"'....'
。这些字符串之间不要留空格。
$ echo 'Haru'\''s Death'
Haru's Death
$ echo 'Haru'"'"'s Death'
Haru's Death
在单引号之间不会解释任何字符,甚至在反斜杠之间也不会解释任何字符(因此您不能这样做echo 'Haru\'s Death'
,这会PS2
提示您(通常是>
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句