Yours commandis a list with one item. Imagine if you tried to run this in a shell:
/bin/'dd if='/dev/'sda8 count=100 skip=$(expr 19868431049 '/' 512)'
It is effective what you do. Your directory has binalmost no directory with the name dd if=, and there is almost no directory devunder the directory sd8 count=100 skip=$(expr 19868431049with the program with the name in it 512.
, , , :
command = ['/bin/dd', 'if=/dev/sda8', 'count=100', 'skip=$(expr 19868431049 / 512)']
print subprocess.check_output(command)
: $(expr 19868431049 / 512) Python dd; bash. , , Python, bash:
command = ['/bin/dd', 'if=/dev/sda8', 'count=100',
'skip={}'.format(19868431049 // 512)]
print subprocess.check_output(command)
, bash , , , shell=True:
command = "/bin/dd if=/dev/sda8 count=100 skip=$(expr 19868431049 / 512)"
print subprocess.check_output(command, shell=True)
, /bin/sh, , , $(…) ( expr), , , POSIX , expr ...). :
command = "/bin/dd if=/dev/sda8 count=100 skip=$(expr 19868431049 / 512)"
print subprocess.check_output(command, shell=True, executable='/bin/bash')