You can run commands in Julia using the following syntax:
run(`echo 123`)
How can I easily run a long command with multiple arguments? It is convenient to split it up over multiple lines for readability purposes. Can I do this in Julia?
Multi-Line Comments Julia multi-line comment is a piece of text enclosed in a delimiter (#=) on start of the comment and (=#) on the end of the comment. A multiline comment is useful when the comment text does not fit into one line; therefore needs to span across lines.
Shell Mode Shell Mode. Typing ; at the beginning of a line enters shell mode. This changes the Julia REPL to run bash commands instead of Julia. In shell mode, the REPL acts like a Bash shell and you can enter your standard bash commands like ls , cd , mkdir , and others.
Julia automatically continues parsing in the next line if the current expression is incomplete, e.g.,
julia> 1 +
2
3
Therefore, you can simply do
julia> run(`
echo
123
345
678
`)
123 345 678
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With