1. When upgrading the Rancher container, executing the SHELL script threw an error: sed: -e expression #1, char 37: unknown option to `s’, as shown in Figure 1.

2. The value of the environment variable CMCP_API_CFG_REDIS_PASSWORD was q5dHP@xCBUUJY^L, which caused the upgrade to fail. After changing the value to q5dHP@xCBUUJYL to remove the ^ symbol, I ran the upgrade again, but it still failed.
3. I then changed the value to q5dHPxCBUUJY^L to remove the @ symbol, and ran the upgrade again. This time, the upgrade succeeded.
sed -i "s@CMCP_API_CFG_REDIS_HOSTNAME@$CMCP_API_CFG_REDIS_HOSTNAME@g" /sobey/www/cmcp-api/.env;
4. Because the value of the environment variable CMCP_API_CFG_REDIS_PASSWORD was q5dHP@xCBUUJY^L, the upgrade failed. I ultimately decided not to change the original value; instead, I modified the SHELL file to replace @ with #, and the upgrade succeeded.
sed -i "s@CMCP_API_CFG_REDIS_HOSTNAME@$CMCP_API_CFG_REDIS_HOSTNAME@g" /sobey/www/cmcp-api/.env;
sed -i "s#CMCP_API_CFG_REDIS_HOSTNAME#$CMCP_API_CFG_REDIS_HOSTNAME#g" /sobey/www/cmcp-api/.env;
5. In summary, in SHELL, the default syntax for searching and replacing data is: sed ‘s/string_to_be_replaced/new_string/g’. However, the / delimiter can be replaced with other characters to avoid conflicts.
