Birisi, aşağıdaki grep komutunu çalıştırmak için Python 2.4 alt işlem yöntemi ile uygun sözdizimi sağlayabilir mi?Python 2.4 alt işlem ve grep birden çok dosyayı Solaris 10 üzerinde
# grep -n down /tmp/support/alarms/SS7Alarms.*
/tmp/support/alarms/SS7Alarms.263:8301:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.264:7733:LAES: SS7MGR: Association Id 1 is down
/tmp/support/alarms/SS7Alarms.264:7737:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.264:12603:LAES: SS7MGR: Association Id 1 is down
/tmp/support/alarms/SS7Alarms.264:12607:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.265:6523:LAES: SS7MGR: Association Id 1 is down
/tmp/support/alarms/SS7Alarms.265:6531:LAES: SS7MGR: Association Id 1 is down
/tmp/support/alarms/SS7Alarms.267:10349:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.270:11159:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.270:13229:LAES: SS7MGR: Association Id 2 is down
/tmp/support/alarms/SS7Alarms.271:13041:LAES: SS7MGR: Association Id 2 is down
Bir tek dosya işe alabilirsiniz: Böyle bir dosya /tmp/support/alarms/SS7Alarms.*
yoktur
p = subprocess.Popen(["grep", "-n", "down", "/tmp/support/alarms/SS7Alarms.*"], shell=True, stdout=subprocess.PIPE)
>>> Usage: grep -hblcnsviw pattern file . . .