- 论坛徽章:
- 50
|
回复 1# Pugna_zfr - $awk '/^Service/{++i}{print >"file"i}' file
- $cat file
- Service "syncdb" has 1 instance(s).
- Instance "syncdb", status READY, has 1 handler(s) for this service...
- Service "syncdbXDB" has 2 instance(s).
- Instance "syncdb1", status READY, has 1 handler(s) for this service...
- Instance "syncdb2", status READY, has 1 handler(s) for this service...
- Service "syncdb_XPT" has 1 instance(s).
- Instance "syncdb", status READY, has 1 handler(s) for this service...
- $cat file1
- Service "syncdb" has 1 instance(s).
- Instance "syncdb", status READY, has 1 handler(s) for this service...
- $cat file2
- Service "syncdbXDB" has 2 instance(s).
- Instance "syncdb1", status READY, has 1 handler(s) for this service...
- Instance "syncdb2", status READY, has 1 handler(s) for this service...
- $cat file3
- Service "syncdb_XPT" has 1 instance(s).
- Instance "syncdb", status READY, has 1 handler(s) for this service...
复制代码 |
|