curl "http://220.181.38.82/m?ct=134217728&tn=baidusg,不得不爱 &word=mp3,http://www.yantaiblog.net/UploadFiles/2007-7/aGhmbGtmbGsx.mp3,,&si=%B2%BB%B5%C3%B2%BB%B0%AE;;%C5%CB%E7%E2%B0%D8;;51913;;51913&lm=16777216"
curl: (3) illegal character in range specification at pos 132
总感觉curl在某些方面有很多缺陷,为何出现这样的情况?
有时 url中 有 & 字符时必需使用在 & 前加转义字符,而有些时候却不需要,为何?
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g;/baidump3/!d"
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g" | sed "/baidump3/!d"
这2个命令执行的结果为何不一样?
### Part 1
The first part of the code is:
```
curl "http://220.181.38.82/m?ct=134217728&tn=baidusg,不得不爱 &word=mp3,http://www.yantaiblog.net/UploadFiles/2007-7/aGhmbGtmbGsx.mp3,,&si=%B2%BB%B5%C3%B2%BB%B0%AE;;%C5%CB%E7%E2%B0%D8;;51913;;51913&lm=16777216"
curl: (3) illegal character in range specification at pos 132
总感觉curl在某些方面有很多缺陷,为何出现这样的情况?
有时 url中 有 & 字符时必需使用在 & 前加转义字符,而有些时候却不需要,为何?
The translated text for the first part is:
The first code block is:
```
curl "http://220.181.38.82/m?ct=134217728&tn=baidusg,不得不爱 &word=mp3,http://www.yantaiblog.net/UploadFiles/2007-7/aGhmbGtmbGsx.mp3,,&si=%B2%BB%B5%C3%B2%BB%B0%AE;;%C5%CB%E7%E2%B0%D8;;51913;;51913&lm=16777216"
curl: (3) illegal character in range specification at pos 132
I always feel that curl has many defects in some aspects. Why does such a situation occur?
Sometimes when there are & characters in the URL, it is necessary to add an escape character before &, but sometimes it is not necessary. Why?
### Part 2
The second part of the code is:
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g;/baidump3/!d"
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g" | sed "/baidump3/!d"
这2个命令执行的结果为何不一样?
The translated text for the second part is:
The second code block is:
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g;/baidump3/!d"
curl http://list.mp3.baidu.com/topso/mp3topsong.html | sed "s/\x22/\xa/g" | sed "/baidump3/!d"
Why do the results of these two commands differ?