bash -c . , , python execve():
bash (execve python - m SimpleHTTPServer)
strace:
$ strace -e clone,fork,vfork,execve -f bash -c "python2 -m SimpleHTTPServer"
execve("/bin/bash", ["bash", "-c", "python2 -m SimpleHTTPServer"], []) = 0
execve("/usr/bin/python2", ["python2", "-m", "SimpleHTTPServer"], []) = 0
Serving HTTP on 0.0.0.0 port 8000 ...
: , . - :
+
bash
+
bash fork() execve() , :
$ strace -e clone,fork,vfork,execve -f bash -c "python2 -V && python2 -m SimpleHTTPServer"
execve("/bin/bash", ["bash", "-c", "python2 -V && python2 -m SimpleH"...], []) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff72d3049d0) = 8631
Process 8631 attached
[pid 8631] execve("/usr/bin/python2", ["python2", "-V"], []) = 0
Python 2.7.5
[pid 8631] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=8631, si_status=0, si_utime=0, si_stime=0} ---
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff72d3049d0) = 8632
Process 8632 attached
[pid 8632] execve("/usr/bin/python2", ["python2", "-m", "SimpleHTTPServer"], []) = 0
Serving HTTP on 0.0.0.0 port 8000 ...
, . zsh execve() python -m simpleHTTPServer , :
zsh (waits for subcommand, then execve python -m sim...) --- execve python -V
strace:
$ strace -e clone,fork,vfork,execve -f zsh -c "python2 -V && python2 -m SimpleHTTPServer"
execve("/bin/zsh", ["zsh", "-c", "python2 -V && python2 -m SimpleH"...], []) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1c5c60a9d0) = 8670
Process 8670 attached
[pid 8670] execve("/usr/bin/python2", ["python2", "-V"], []) = 0
Python 2.7.5
[pid 8670] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=8670, si_status=0, si_utime=0, si_stime=0} ---
execve("/usr/bin/python2", ["python2", "-m", "SimpleHTTPServer"], []) = 0
Serving HTTP on 0.0.0.0 port 8000 ...