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("\\", "\\\\");