인쇄하는 대신,
============ 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#/# - #'