Create external command from string


#1

are backticks the only way to construct a command for the ‘run’ function:

for example:

julia> cmd = “pwd”::String
“pwd”

julia> run($cmd)
/home/warmstrong
Process(pwd, ProcessExited(0))

julia>

what is the ` function?

Is there a way to create a command from a string with a function other than the backtick?


#2
julia> Cmd(["ls", "-la"]) == `ls -la`
true

#3

@cmd "ls -l" or Cmd(["ls", "-l"]) will do what you want (producing the `ls -l` command).


#4

thanks. I think ‘Cmd’ is more readable.