python shell 引号 管道符 处理

2019-11-22  本文已影响0人  虚心的锄头
comm = ['/bin/find', '/', '-type', 'f', '-name', 'passwd', '|', 
            'xargs', 'grep', '-Ein', '-A', '1', '\'root "|zhangsan\'', '|', 'grep', '"}"']
comms = ' '.join(comm)
out = subprocess.call(comms, shell=True)

上一篇 下一篇

猜你喜欢

热点阅读