Hi. I realise this is quite old, but Cmd() is not recognised (maybe deprecated?) and @cmd doesn’t seem to work very well. Even doing something simple like:
ls -lt | head
is something I cannot get to work. First trying
mycmd = @cmd “ls -lt | head”
Yields a warning that I should use quotes around the pipe:
mycmd = @cmd “ls -lt ‘|’ head”
is accepted, but then when I try
run(mycmd)
the response is
julia> run(mycmd)
ls: head: No such file or directory
ls: |: No such file or directory
ERROR: failed process: Process(ls -lt '|' head, ProcessExited(1)) [1]
[The shell seems to not see the pipe and looks for the file ‘head’ which isn’t there.]
The problem you are having is that ls -lt | head is a shell pipeline, but Cmd is not a shell — it is a way of launching individual programs. So, what you are doing is calling ls with filenames | and head, which is not what you want.