有一个导出的env变量X
:
X="-t \"2 2.1\""
使用此变量时,以下命令解析错误:
yarn jest $X
yarn jest -t '"2' '2.1"'
代替:
yarn jest -t "2 2.1"
我读过很多类似的问题,但没有一个起作用。有什么帮助吗?
考虑为此使用shell数组:
arr=('-t' '2 2.1')
然后将其用作:
yarn jest "${arr[@]}"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句