Use of nohup inside the run() command

Hello everyone! Congratulations on the release of version 1.8 of Julia, it just keeps getting better and better! I would like to ask the following question: What is the correct form of the command?
run(`nohup julia test.jl $s \> report.out \&`)
It is not directing to report.out, but to nohup.out. (I have already searched the similar topics). I need to make several calls like this, each directing to a specific output. Thanks.

# test.jl file
function test()
	sleep(20)
	x = length(ARGS) ≥ 1 ? parse(Float64, ARGS[1]) : 0.0
	println(x^0.5)
end

test()
# end test.jl file


# run.jl file
function main()
	s = length(ARGS) ≥ 1 ? parse(Float64, ARGS[1]) : 0.0
	run(`nohup julia test.jl $s \> report.out \&`)
	# is not directing to report.out 
end

main()
# end file

terminal> julia run.jl 2.0

You can do

  run(`bash -c "nohup julia test.jl $s > report.out &"`)

instead.

3 Likes

Very good, thank you.