基本上就是每個參數都分開,如果指令為這樣..
輸入的時候則為
如果想要測試參數怎麼設定,可以直接測 linux 的 execve 或者 execv
從 souce code 可以看到
https://github.com/python/cpython/blob/master/Lib/subprocess.py#L489
run -> Popen-> init()
https://github.com/python/cpython/blob/71876fa438f706b211360d8c205cb985906212ee/Lib/subprocess.py#L845
_execute_child->_posixsubprocess.fork_exec
https://github.com/python/cpython/blob/71876fa438f706b211360d8c205cb985906212ee/Lib/subprocess.py#L1624-L1631
_posixsubprocess.c ->child_exec
https://github.com/python/cpython/blob/762f93ff2efd6b7ef0177cad57939c0ab2002eac/Modules/_posixsubprocess.c#L511-L518
-> execve 或者 execv
這兩個部分屬於 linux 的函式呼叫
https://linux.die.net/man/2/execve
再追下去就是 linux lib 的部分了
Windows 有則是先組字串再執行
https://github.com/python/cpython/blob/71876fa438f706b211360d8c205cb985906212ee/Lib/subprocess.py#L1218