Skip to content

Instantly share code, notes, and snippets.

@leo-pfeiffer
Last active August 14, 2021 20:04
Show Gist options
  • Save leo-pfeiffer/37454eecf26f9657be92959124f22590 to your computer and use it in GitHub Desktop.
Save leo-pfeiffer/37454eecf26f9657be92959124f22590 to your computer and use it in GitHub Desktop.
Shell script for starting multiple processes
#!/bin/bash
# first process
cd ~/Desktop/folder1
# start your first process with nohup
# (the `&` is important)
nohup python proc1.py > proc1.out 2>&1 &
echo "proc2.py PID:" $!
# same for the second process
cd ~/Desktop/folder2
nohup python proc2.py > proc2.out 2>&1 &
echo "proc2.py PID:" $!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment