我想从abc.sh脚本调用xyz.sh脚本,但xyz.sh在运行脚本时需要参数。启动脚本时传递的参数是xyz.sh -base onetwo.so如何从abc.sh脚本调用xyz.sh脚本,这样我也需要传递参数。
abc.sh脚本包含
#!/bin/bash
echo "This script is about to run script."
sh ./xyz.sh
echo "This script has finished script."
我怀疑你是如何在执行abc.sh中的xyz.sh时传递参数“-base onetwo”的? 注意:这里onetwo可以是任何变化的字符串
请帮助解决此问题
答案 0 :(得分:0)
尝试这样:
#!/bin/bash
echo "This script is about to run script."
sh ./xyz.sh param1 param2
echo "This script has finished script."