Unix Review > Archives > 2001 > December 2001

December 2001

Shell Corner: findp, Enhanced findp, and where

Revisiting PST

Before presenting this month's scripts, I'd like to address a comment from reader Barry Ard (barry.ard@ualberta.ca), who submitted the following constructive criticism concerning October's PST column:

I don't know about about other Unix operating systems, but Solaris, since at least 2.6, provides /usr/proc/bin/ptree that will do the same thing as PST.

Barry is absolutely correct; the output of pstree, part of the /proc virtual file system, is similar to PST. For more information on /proc, see the Sys Admin article, "The /proc File System," by Werner Klauser.

Searching PATH with findp

This month, Robert S. Sciuk (rob@ControlQ.com) submits findp, a Bourne shell script for seaching PATH for a given file. findp takes one or more arguments that are executable files, searches PATH for their location, and displays all matches to standard output.

At first, I was hesitant to use Robert's script, because most Unix variants possess either built-in or external PATH search capabilities. SCO Open Server V and Solaris 7 Korn shells have the built-in search command whence, and Red Hat 7.1 has the external search command which. However, Robert did present a compelling argument:

On FreeBSD, which and whereis are implemented as Perl scripts..

Sys Admin Spotlight

CMP DevNet Spotlight

Global Web Site Performance Improvement
Jeffrey Fulmer explains how to get a comprehensive picture of your site's performance and describes some tips for improving it.

In the News

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 11.0

Version 11.0 delivers every issue of Sys Admin from 1992 through 2005 and every issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!




MarketPlace

NEW! Numara FootPrints 9 - Service Desk Management
IT Service Management that Delivers. Real Value. Real Flexibility. Real Results. Free Demo.

Online Crash Analysis
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Visit Dell� Small and Medium Business Online Store
One Stop to Buy All Your Business IT Solutions. Browse Through Dell's Best Deals Online Now!

Wanna see your ad here?