0
Im在CentOs上運行dotnet核心控制檯應用程序。以下代碼正在執行正常命令liki「正常運行時間」。但不執行的「LZ4 -dc --no稀疏vnp.tar.lz4 |焦油XF - Logs.pdf」使用dotnet核心在Centos上執行linux命令
try
{
var connectionInfo = new ConnectionInfo("server","username",new PasswordAuthenticationMethod("username", "pwd"));
using (var client = new SshClient(connectionInfo))
{
client.Connect();
Console.WriteLine("Hello World!");
var command=client.CreateCommand("lz4 -dc --no-sparse vnp.tar | tar xf - Logs.pdf");
var result = command.Execute();
Console.WriteLine("yup ! UNIX Commands Executed from C#.net Application");
Console.WriteLine("Response came form UNIX Shell" + result);
client.Disconnect();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
預計產量Logs.pdf文件需要被提取並保存在當前位置。有人可以糾正我在哪裏IM