Executing multiple processes without waiting for their exit status.

Hello Friends,

Hope you are doing well.

I just need a help in executing multiple processes.

I've written a shell script which calls another scritps. But the problem is there are too many processes to run, and each process takes about a min to finish its execution.

So, I want to just execute processes one after another without waiting for their termination.

Any help would be highly appereciated.

Thanks,
Chandan Singh

Try using nohup and run the process in the background with &

Thanks for your suggestion, Mate.

Nohup will create a nohup.out and will run the process in background.

Is there any other way to achieve this without using nohup?

Thanks,
Chandan

Hi.

The GNU versions of xargs can manage processes:

       --max-procs=max-procs
       -P max-procs
              Run up to max-procs processes at a time; the default is  1.   If
              max-procs  is 0, xargs will run as many processes as possible at
              a time.  Use the -n option with -P; otherwise chances  are  that
              only one exec will be done.

-- excerpt from man xargs

See also GNU Parallel - GNU Project - Free Software Foundation

Best wishes ... cheers, drl

1 Like