Hi Jürgen,
zgrep doesn't work without grep from the AIX Toolbox, because /opt/freeware/bin/grep is used by that tool. I think the gzip RPM (which includes zgrep) needs a dependency to grep from the AIX Toolbox, because the path seems to be hardcoded and the options of grep (AIX) and grep (Toolbox) are different.
# Example with installed grep
root@aix00001 /root# which grep
/usr/bin/grep
root@aix00001 /root# rpm -q grep
grep-3.7-1.ppc
root@aix00001 /root# zgrep nv /opt/freeware/info/gzip.info.gz | head -n1
grep_64: /opt/freeware/info/gzip.info.gz: binary file matches
Foundation; with no Invariant Sections, with no Front-Cover Texts,
# Example with removed grep
root@aix00001 /root# rpm -e grep
root@aix00001 /root# which grep
/usr/bin/grep
root@aix00001 /root# zgrep nv /opt/freeware/info/gzip.info.gz | head -n1
/opt/freeware/bin/zgrep[252]: /opt/freeware/bin/grep: not found.
# Checked the zgrep-script and found this line which shows the hard dependency
grep='${GREP-'\''/opt/freeware/bin/grep'\''}'
------------------------------
Niklas
System Engineer UNIX and Linux on Power
------------------------------
Original Message:
Sent: Wed October 05, 2022 01:51 AM
From: Juergen Maehlmann
Subject: gzip requires grep (zgrep depends on grep)
Hi Niklas,
file /opt/freeware/bin/zgrep
/opt/freeware/bin/zgrep: shell script - sh (default shell)
There is no forced dependency for grep .....
except that:
lslpp -w /usr/bin/grep
File Fileset Type
----------------------------------------------------------------------------
/usr/bin/grep bos.rte.commands File
which is installed by default.
change your PATH to include the normal /usr/bin and zgrep works as designed.
------------------------------
Juergen Maehlmann
Original Message:
Sent: Tue October 04, 2022 02:23 AM
From: Niklas V.
Subject: gzip requires grep (zgrep depends on grep)
Hi community,
we found out that zgrep needs the grep from the AIX Toolbox. Is it possible to add grep as dependency to gzip?
# zgrep nv /opt/freeware/info/gzip.info.gz/opt/freeware/bin/zgrep[252]: /opt/freeware/bin/grep: not found.
------------------------------
Niklas
System Engineer UNIX and Linux on Power
------------------------------