ramthen has asked for the wisdom of the Perl Monks concerning the following question:

Belated new year wishes to all monks ,

Recently I used functions from win32 module to obtain list of software installed and also system resources.

Is there any module to do same on Unix systems ?

Am looking at modules b'cos I thought they would be generic across all falvors of Unix operating systems ; also this would prevent me writing code specific to one flavor.

thanks

RamThen

  • Comment on Modules to find system resources on Unix

Replies are listed 'Best First'.
Re: Modules to find system resources on Unix
by b10m (Vicar) on Jan 08, 2004 at 14:36 UTC

    If I understand your question right, you want to find a module that would list all installed software on *NIX platforms, right? If so, I think this is close to impossible, due to the differences. FreeBSD (and other *BSDs) use the ports collection for software installation, while Debian uses apt and RedHat uses rpm. And now I only listed 3 flavors ;)

    Besides these methods, it's still quite common on *NIX machines to compile software yourself and install them in any place you see fit.

    My best bet for you would be to scan the following directories. That should find *most* software.

    • /bin/
    • /sbin/
    • /usr/bin/
    • /usr/sbin/
    • /usr/local/bin/
    • /usr/local/sbin/

    (and/or check out the $PATH enviroment variable)

    As for the system resources, what type of information are you exactly looking for?

    HTH

    --
    b10m
Re: Modules to find system resources on Unix
by Abigail-II (Bishop) on Jan 08, 2004 at 15:23 UTC
    Is there any module to do same on Unix systems ?
    No, if only for the fact there are a gazillion different Unix systems, all different, and while some Unix flavours have one or more software package systems (there are a bazillion systems for Linux), I don't know any Unix system that requires the use of a software package to install software.

    As for "system resources", you have to be a bit more specific. For some resources, there might be modules that work for some Unix flavours.

    Just for fun, you might want to look in the Configure script (with associated hint files) that comes with a Perl distribution, what is needed to find out in a portable way what is available. And those are the easy things, like figuring out the capabilities of the compiler.

    Abigail

      Abigail alludes to the two edged sword of Unix, there are no required or standardized application installers across all flavors. While this may seem weird and complicated to many users coming from a windows back-end -- it frees us from having systems tied to a registry like nightmare. For instance if I install a ton of programs on my /export partition and localize the dependent files in that partition I can completely wipe the disk (except for that partition) and start over anew with a clean install, mount the /export partition and have all my apps back without worrying about reinstalling them to appease the registry settings. With this freedom comes the cost that administrating these machines requires a larger knowledge base than windows boxes.


      -Waswas
Re: Modules to find system resources on Unix
by dominix (Deacon) on Jan 08, 2004 at 20:51 UTC

    As sayd before, there is no standardized ways to check installed software. You could however check for most used modules for installer system like DPKG::* RPM::* Solaris::Package . I would mention that everything installed directly from source would not appear in these list, but after all isn't it the same on MS-windows ?

    Regarding system resources there is similar problems, some have been discust recently here : Using Perl to detect RAM amount.
    HTH
    --
    dominix