【发布时间】:2015-07-18 03:37:26
【问题描述】:
script.sh:
#!/bin/bash
echo "First argument: $1"
包装器.sh:
#!/bin/bash
CALLER='./script.sh "this should be one argument"'
$CALLER
会发生什么:
$ ./wrapper.sh
First argument: "this
我所期待的:
$ ./wrapper.sh
First argument: this should be one argument
我尝试了不同的练习以使其按我想要的方式工作,但我找不到使用包含 wrapper.sh 中的空格的单个参数调用 script.sh 的方法。
我也想了解嵌套引号的解释方式。
【问题讨论】: