From 761a094d604cab02a962e62ac4f2572a55c1259c Mon Sep 17 00:00:00 2001 From: root <295172551@qq.com> Date: Sat, 14 Jun 2025 00:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=AE=9A=E4=B9=89=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Command/Executors/LinuxCommandExecutor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CoreAgent.Infrastructure/Command/Executors/LinuxCommandExecutor.cs b/CoreAgent.Infrastructure/Command/Executors/LinuxCommandExecutor.cs index 54576be..4939a23 100644 --- a/CoreAgent.Infrastructure/Command/Executors/LinuxCommandExecutor.cs +++ b/CoreAgent.Infrastructure/Command/Executors/LinuxCommandExecutor.cs @@ -91,10 +91,9 @@ public class LinuxCommandExecutor : BaseCommandExecutor throw new ArgumentException("命令不能为空", nameof(command)); } - // 使用双引号包裹整个命令,并对特殊字符进行转义 + // 使用双引号包裹整个命令,只对必要的特殊字符进行转义 var escapedCommand = command .Replace("\"", "\\\"") - .Replace("$", "\\$") .Replace("`", "\\`") .Replace("\\", "\\\\");