【发布时间】:2018-10-17 22:43:12
【问题描述】:
每当我在带有“|”的子进程中使用命令时在它不起作用时它的输出为 命令“|”未知,请尝试“在链接帮助中”。 或者当我这样说时:
#!/usr/bin/python
from subprocess import call
from shlex import split
interface = call(split("ip -o link show | awk '{print $2}' | grep wl"))
它给出的输出是:
Error: either "dev" is duplicate, or "awk" is a garbage.
【问题讨论】:
-
有没有办法让它工作
标签: python command subprocess shlex