Im launching the dotnet console application in the CentOs window. the code below is executed for the normal liki "uptime" command. but not executed for "lz4 -dc --no-sparse vnp.tar.lz4 | tar xf - Logs.pdf"
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); }
Expected Result: The Logs.pdf file should be extracted and saved in the current location. Can someone fix me where im
source share