擅长:python、mysql、java
<p>当您将引号字符放入变量中时,它们只会变成纯文本(请参见<a href="http://mywiki.wooledge.org/BashFAQ/050" rel="nofollow">http://mywiki.wooledge.org/BashFAQ/050</a>;感谢@tripleee指出此链接)</p>
<p>相反,请尝试使用数组传递参数:</p>
<pre><code>argumentString=(-ir 'hello world')
grep "${argumentString[@]}" .
</code></pre>