印刷する代わりに、
============ Normal grep location of the files ============
ems_inet1/SystemOut1.log
ems_rpt1/SystemOut_19.09.09_23.00.00.log
ems_rpt1/SystemOut_19.09.11_23.00.00.log
============ Compress grep location of the files ============
ems_rpt1/SystemOut_19.05.12_23.00.00.log.gz
これを印刷したいのですが、
============ Normal grep location of the files ============
ems_inet1 - SystemOut1.log
ems_rpt1 - SystemOut_19.09.09_23.00.00.log
ems_rpt1 - SystemOut_19.09.11_23.00.00.log
============ Compress grep location of the files ============
ems_rpt1 - SystemOut_19.05.12_23.00.00.log.gz
スラッシュを使わずに「-」ダッシュで区切りたいです。
これは私のコードです
echo "============ Normal grep location of the files ============"
grep -Erl "${input}" ems*/SystemOut*.log
#
echo "============ Compress grep location of the files ============"
zgrep -Erl "${input}" ems*/SystemOut*.log.gz
答え1
grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'