I have some problems calling commands from a Linux .net core consol application.
Sub Main()
Dim PI As New ProcessStartInfo
Using Proc As New Process
With PI
.FileName = "cat"
.Arguments = "/etc/*-release"
.RedirectStandardOutput = True
.UseShellExecute = False
.CreateNoWindow = True
End With
Proc.StartInfo = PI
Proc.Start()
PI = Nothing
Console.Write(Proc.StandardOutput.ReadToEnd)
End Using
End Sub
I get this error:
cat: '/etc/*-release': No such file or directory
It work if I disable redirection and set UseShellExecute = True, but I would like to be able to use the output in my code.
/etc/*-release. Not that familiar with the language, but perhaps it has a wrapper or equivalent for the Unix Cglob()function?