1. In a Shell script, the following runtime error occurred: /config/init/config0.sh line 184 APPID unbound variable. See Figure 1.

<br>/config/init/config0.sh: line 184: APPID: unbound variable<br><br>2. Inspecting the Shell script, the assignment is: https://console.${RMT_MAIN_DOMAIN}/ccpauth/wx-msg-event/$APPID$/receive. ${RMT_MAIN_DOMAIN} needs to be replaced with dev.xxx.cn. $APPID$ should not be replaced and must remain as is, but it is now being treated as a variable. This causes the error.
if [[ `echo $RMT_MAIN_DOMAIN` == '' ]]
then
echo "需要设置 RMT_MAIN_DOMAIN"
exit 1
else
echo "设置的 RMT_MAIN_DOMAIN 为:$RMT_MAIN_DOMAIN"
fi
env | grep "CHANNEL_PUB_API_CFG_WX_OPEN_COMPONENT_MSG_EVENT_RECEIVE" || export CHANNEL_PUB_API_CFG_WX_OPEN_COMPONENT_MSG_EVENT_RECEIVE="https://console.${RMT_MAIN_DOMAIN}/ccpauth/wx-msg-event/$APPID$/receive"
3. Edit the Shell script to change $APPID$ to \$APPID\$. Add an escape character before each $. The code is as follows:
env | grep "CHANNEL_PUB_API_CFG_WX_OPEN_COMPONENT_MSG_EVENT_RECEIVE" || export CHANNEL_PUB_API_CFG_WX_OPEN_COMPONENT_MSG_EVENT_RECEIVE="https://console.${RMT_MAIN_DOMAIN}/ccpauth/wx-msg-event/\$APPID\$/receive"
4. At runtime, the error no longer occurs. Checking the runtime log confirms no further errors. See Figure 2.

CHANNEL_PUB_API_CFG_WX_OPEN_COMPONENT_MSG_EVENT_RECEIVE replace https://console.dev.xxx.cn/ccpauth/wx-msg-event/$APPID$/receive -> /mcloud/www/ccp_api/environments/dev/common/config/params-local.php
5. Check the final replacement result in /mcloud/www/ccp_api/environments/dev/common/config/params-local.php. ${RMT_MAIN_DOMAIN} has been replaced with dev.xxx.cn. $APPID$ was not replaced and remains as is. This matches the expected outcome. See Figure 3.

