反引号与$()的输出不同

时间:2019-04-20 21:06:36

标签: bash backquote

以下代码:

url="http%3A%2F%2Fstackoverflow.com%2Fsearch%3Fq%3Durldecode%2Bbash"

line=`echo -e ${url//%/\\x}`; 
echo $line;

line=$(echo -e ${url//%/\\x}); 
echo $line;

产生:

httpx3Ax2Fx2Fstackoverflow.comx2Fsearchx3Fqx3Durldecodex2Bbash
http://stackoverflow.com/search?q=urldecode+bash

``和$()是否会产生相同的结果?

0 个答案:

没有答案