我有一個腳本,輸出以下輸出:正確管道輸入到grep和在其上對位執行正則表達式和匹配的字符串
總體狀態 - 行(採樣週期9秒) - 物理驅動器名稱=」 0 C:「(OK)_PercentIdleTime = 100%_PercentBusyTime = 0% _PercentDiskTime = 1%_PercentDiskReadTime = 0%_PercentDiskWriteTime = 1%_DiskReadBytesPersec = 0.000B/sec _DiskReadsPersec = 0.000/sec _DiskWriteBytesPersec = 0.00MB/sec,_DiskWritesPersec = 8.000/sec,CurrentDiskQueueLength = 0,_AvgDiskQueueLength = 0.0,_AvgDiskReadQueueLength = 0.0,_AvgDiskWriteQueueLength = 0.0 |'_PercentIdleTime0 C:'= 100; '_PercentBusyTime0 C:'= 0; '_PercentDiskTime0 C:'= 1; '_PercentDiskReadTime0 C:'= 0; '_PercentDiskWriteTime0 C:'= 1; '_DiskReadBytesPersec0 C:'= 0; '_DiskReadsPersec0 C:'= 0; '_DiskWriteBytesPersec0 C:'= 71917; '_DiskWritesPersec0 C:'= 8; 'CurrentDiskQueueLength0 C:'= 0; '_AvgDiskQueueLength0 C:'= 0.0; '_AvgDiskReadQueueLength0 C:'= 0.0; '_AvgDiskWriteQueueLength0 C:'= 0.0;
使用grep我想過濾掉一切,但_DiskWriteBytesPersec = 0.00MB
我用下面的正則表達式上http://regexr.com/成功地這樣做: (_DiskWriteBytesPersec =(\ d *)? 。(\ d *)MB)
但我很難讓它與grep一起工作。
請看看[editing-help](http://stackoverflow.com/editing-help)。 – Cyrus