I have a question about syntax of bash regarding launching scripts from within bash script.
My questions are:
I've seen the following syntax:
#!/bin/bash python do_something.py > /dev/null 2>&1 &
Can you please explain what is directed to
/dev/null
, and what is the meaning of2>&1
if before already mentioned/dev/null
?In addition if I have a line defined like:
python do_something.py > 2>&1 &
how is that different?
If I have the same python file in many paths, how can I differentiate between each process after launching
ps -ef |grep python
. When I'm doing so, I get a list of processes which are all calleddo_something.py
, it would be nice if I could have the full execution path string of each pid; how can I do that?
NOTE: The python file launched is writing its own log files.