【发布时间】:2021-05-17 16:00:32
【问题描述】:
我有一个脚本名称 first.sh,其中我调用了几个变量,如下所示:
#!/bin/bash
index1_0="a_b_c"
index2_0="b_c_d"
index3_0="c_d_e"
first.sh 的脚本路径是 goal/first.sh。我正在尝试在另一个 second 中使用 first.sh 中调用的上述变量.erb 文件如下:
% H = Hash["a" => "@index1_0",
% "b" => "@index2_0",
% "d" => "@index3_0",]
我需要在 second.erb 文件中使用 first.sh 脚本文件中声明的变量,但没有得到准确的输出。有人可以帮忙吗?
【问题讨论】:
-
but not getting the exact output是什么意思?您的意思是“避免执行脚本”吗? -
@BroiSatse 我需要 .erb 语法来调用 first.sh 脚本中使用的变量