相关疑难解决方法(0)

将字符串转换为参数时,Bash不解析引号

这是我的问题.在bash 3中:

$ test='One "This is two" Three'
$ set -- $test
$ echo $2
"This
Run Code Online (Sandbox Code Playgroud)

如何获得的bash了解行情,并返回$ 2作为This is two和不"This?不幸的是,我不能改变test这个例子中调用的变量的构造.

string bash arguments spaces quoting

11
推荐指数
2
解决办法
2981
查看次数

标签 统计

arguments ×1

bash ×1

quoting ×1

spaces ×1

string ×1