-1

Now, I'm running on server.

Log management is performed with nohup, the result is output in 5 units.

nohup shell script code is like this.

nohup python main.py &
nohup python main.py &
nohup python main.py &
nohup python main.py &
nohup python main.py &

the outputs came out in units of five.

like this >>> IMAGE

I want the log files made of the shell script code above to be printed in order, not just the fifth.

How can I do?

YLR
  • 1,503
  • 4
  • 21
  • 28
bhnvx
  • 25
  • 6
  • Please [don’t post images of code or error messages.](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557) – tripleee Sep 26 '21 at 12:01

1 Answers1

0

try piping your output into sort like:

nohup python main.py | sort &

But I am not sure why you are running the same python script 5 times. I believe nohup outputs to a log file in the directory where the command is run, if anything, try cat nohup.out | sort

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 17 '21 at 20:46
  • thanks! i will try later :) The reason it works 5 times is because the server has 5 CPUs. – bhnvx Sep 27 '21 at 05:01