fix(base): 修复screen会话启动时的引号转义问题 修复了启动Screen会话时由于引号转义导致的时间戳变量无法正确传递的问题, 现在通过分离命令参数的方式确保变量能够正确传递到bash环境中。 ```
This commit is contained in:
@@ -285,7 +285,10 @@ chmod +x "%s{exe_path}" || { echo "❌ 设置权限失败"; exit 1; }
|
||||
# 定义时间戳(格式:年-月-日_时-分-秒,比如 2026-03-03_15-30-25)
|
||||
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
echo "启动Screen会话[%s{screen_name}]..."
|
||||
screen -dmS "%s{screen_name}" bash -c '"%s{exe_path}" -id=%s{online_id} 2>&1 | tee -a "$HOME/run_${timestamp}.log"'
|
||||
# 4. 启动screen会话(修复引号转义,让timestamp变量正确传递)
|
||||
screen -dmS "${screen_name}" bash -c '
|
||||
"%s" -id=%s 2>&1 | tee -a "$HOME/run_%s.log"
|
||||
' "${exe_path}" "${online_id}" "${timestamp}"
|
||||
|
||||
sleep 2
|
||||
if screen -ls | grep -q "%s{screen_name}"; then
|
||||
|
||||
Reference in New Issue
Block a user