e.g., I want run a python -m HTTPSimpleServer in the background while running a watch in the background
python -m HTTPSimpleServer; watch -n (my awesome test command)
how can I run both in parallel spawning from one command.
e.g., I want run a python -m HTTPSimpleServer in the background while running a watch in the background
python -m HTTPSimpleServer; watch -n (my awesome test command)
how can I run both in parallel spawning from one command.
python -m HTTPSimpleServer & # Your Python process will now be in the background
serverpid="$!" # Capture its PID so that you can kill it later.
watch -n /path/to/AwesomeTestCommand Arg1 Arg2
# Some time later...
kill "$serverpid" # Make your Python process go away
Looks like replacing the ; with & ought to do the job. Add another & at the end to put both programs in the background.
This may sound like a reply to an old post, but you can simply run the application in nohup
nohup python -m HTTPSimpleServer & watch -n