AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  gzip requires grep (zgrep depends on grep)

    Posted Tue October 04, 2022 02:23 AM
    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
    ------------------------------


  • 2.  RE: gzip requires grep (zgrep depends on grep)

    Posted Wed October 05, 2022 01:51 AM
    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
    ------------------------------



  • 3.  RE: gzip requires grep (zgrep depends on grep)

    Posted Wed October 05, 2022 02:03 AM
    Edited by Niklas Vosskoetter Wed October 05, 2022 02:30 AM
    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
    ------------------------------



  • 4.  RE: gzip requires grep (zgrep depends on grep)

    Posted Wed October 05, 2022 09:25 AM
    Thanks Niklas. 
    Yes for zgrep you need AIX toolbox grep as it might be using options from gnu grep. 
    We can look at adding that dependency for gzip package.
    Actually as many people would not use zgrep and dependency list is keep increasing for AIX toolbox package we are adding what is absolute required.
    Meanwhile you can install grep from AIX toolbox for zgrep to work.

    ------------------------------
    SANKET RATHI
    ------------------------------