我有以下的Python行:Python的子進程擊:花括號
import subprocess
subprocess.Popen("egrep -r --exclude=*{.git,.svn}* \"text\" ~/directory", stdout=subprocess.PIPE, shell=True).communicate()[0]
不幸的是,bash中完全忽略--exclude = * {GIT中,使用svn。} *標誌。
我已經將問題縮小到大括號。 --exclude = *。git *將通過python的popen工作,但是當引入花括號時,我無可奈何。有什麼建議麼?
注意:我嘗試使用Python的命令庫運行命令,它會產生完全相同的輸出 - 並且完全相同的忽略--exclude標誌。
這個和指定bash shell的工作很好! – user1115304 2012-01-06 00:37:54