コマンド出力からテキストの特定の部分を取得します。

コマンド出力からテキストの特定の部分を取得します。

いくつかのファイルのリストと他の詳細を含む複数の出力を提供するコマンドがあります。このコマンドまたはスクリプトの出力例は次のとおりです。

HOST NAME: ABC.us.XYZ.com
DESCRIBING VIEW: ...
TRANS_STATE: OPEN

ALL AFFECTED FILES:
  1.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/EmailAddressEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  2.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/NationalIdentifierEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  3.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/PhoneEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  4.    abc/xyz/components/xyzCoreSetup/.adf/META-INF/connections.xml 
  5.    abc/xyz/components/xyzCoreSetup/absenceManagement/absences/ui/xyzAbsMgmtAbsencesUi.jpr 


CHECKEDOUT RESERVED:
  1.    abc/xyz/components/xyzCoreSetup/.adf/META-INF/connections.xml [edward_view2_brown]
  2.    abc/xyz/components/xyzCoreSetup/absenceManagement/absences/ui/xyzAbsMgmtAbsencesUi.jpr [edward_view2_brown]
  3.    abc/xyz/components/xyzCoreSetup/absenceManagement/accruals/ui/xyzAbsMgmtAccrualsUi.jpr [edward_view2_brown]
  4.    abc/xyz/components/xyzCoreSetup/absenceManagement/calendarEvents/ui/xyzAbsMgmtCalendarEventsUi.jpr [edward_view2_brown]
  5.    abc/xyz/components/xyzCoreSetup/absenceManagement/workSchedules/ui/xyzAbsMgmtWorkSchedsUi.jpr [edward_view2_brown]


BACKEND BRANCHED ELEMENTS:
================================================================================
abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/EmailAddressEOImpl.java@@/main/st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown/edward_tras1/1
abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/NationalIdentifierEOImpl.java@@/main/st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown/edward_tras1/1
================================================================================

以下に示すような出力が必要です。可能であれば、ファイルに書き込んだり、番号付けを削除したりすると便利です。

  1.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/EmailAddressEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  2.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/NationalIdentifierEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  3.    abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/PhoneEOImpl.java  [MERGE TO BRANCH -> st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown ]
  4.    abc/xyz/components/xyzCoreSetup/.adf/META-INF/connections.xml 
  5.    abc/xyz/components/xyzCoreSetup/absenceManagement/absences/ui/xyzAbsMgmtAbsencesUi.jpr 
  1.    abc/xyz/components/xyzCoreSetup/.adf/META-INF/connections.xml [edward_view2_brown]
  2.    abc/xyz/components/xyzCoreSetup/absenceManagement/absences/ui/xyzAbsMgmtAbsencesUi.jpr [edward_view2_brown]
  3.    abc/xyz/components/xyzCoreSetup/absenceManagement/accruals/ui/xyzAbsMgmtAccrualsUi.jpr [edward_view2_brown]
  4.    abc/xyz/components/xyzCoreSetup/absenceManagement/calendarEvents/ui/xyzAbsMgmtCalendarEventsUi.jpr [edward_view2_brown]
  5.    abc/xyz/components/xyzCoreSetup/absenceManagement/workSchedules/ui/xyzAbsMgmtWorkSchedsUi.jpr [edward_view2_brown]
abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/EmailAddressEOImpl.java@@/main/st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown/edward_tras1/1
abc/xyz/components/xyzCore/people/core/protectedModel/src/oracle/apps/xyz/people/core/protectedModel/entity/NationalIdentifierEOImpl.java@@/main/st_abc_pt-v2mib/st_abc_pt-v2mibxyzgold/st_abc_pt-v2mibxyzgray/st_abc_pt-v2mibxyzbrown/edward_tras1/1

ベストアンサー1

あなたabc/xyz/

| grep -o 'abc/xyz/.*' > output
  • -o一致する部分を印刷するだけです。
  • .*行のすべての文字
  • >出力をファイルに送信output

おすすめ記事