fhg
Volume 7, Number 3 -- January 24, 2007

Legible PATH and CLASSPATH

Published: January 24, 2007

by Ted Holt

Dear Professional:

One of the things I don't like about the Integrated File System (IFS) is its directory-based structure of untyped files. I consider the library system of strongly typed objects a much more robust architecture. Nevertheless, the IFS is reality and I have to deal with it. Here's a short and simple tip for reading those ugly, almost indecipherable PATH and CLASSPATH variables we have to put up with.

The PATH and CLASSPATH variables contain lists of directories, separated with colon characters. They function like library lists, in that the system searches the lists when looking for certain things. The PATH variable lists the directories that are to be searched when looking for files. The CLASSPATH variable lists the directories that are to be searched for Java classes. The longer these variables get, the uglier they get. Here's an example of a relatively benign CLASSPATH.

.:/Aps:/java/msbase.jar:/java/msutil.jar:
/java/mssqlserver.jar:/qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar

A simple Qshell command gives CLASSPATH an air of civilization.

echo $CLASSPATH | tr ":" "\n"

Here's the result:

.                                             
/Aps                                          
/java/msbase.jar                              
/java/msutil.jar                              
/java/mssqlserver.jar                         
/qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar

So how does it work? The echo command writes the CLASSPATH value to standard output. The pipe (vertical bar) picks up echo's output and passes it along to the tr (translate) utility, which converts colons to line-feed characters. The output goes to standard output, which in this case is a green-screen Qshell session.

Want to make it even clearer? Number the lines!

echo $CLASSPATH | tr ":" "\n" | cat -n

Here's the numbered list:

1  .                                             
2  /Aps                                          
3  /java/msbase.jar                              
4  /java/msutil.jar                              
5  /java/mssqlserver.jar                         
6  /qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar

The second pipe feeds the output of tr to the cat utility, which displays the lines. The n switch tells cat to number the lines as it displays them.

--Ted



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
WORKSRIGHT SOFTWARE

Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?

We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

Just call us and we'll arrange for 30 days FREE use of either
ZIP/CITY or PER/ZIP4.

WorksRight Software, Inc.
Phone: 601-856-8337
Fax: 601-856-9432
E-mail: software@worksright.com
Web site: www.worksright.com


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Computer Keyes:  Rapidly convert *SCS printer files into black and white or full color PDF documents
Databorough:  X-analysis is the world leader in AS/400 application retro-documentation
COMMON:  Join us at the 2007 conference, April 29 – May 3, in Anaheim, California


The Four Hundred
Big Blue Readies Revamped Storage for the System i

IBM Closes Out 2006 With a Strong Fourth Quarter

Zend Describes Multiple Instances on i5/OS, Previews RPG Wrapper

Ask TPM: The Economics of Open Source Software

The Linux Beacon
OSDL and Free Standards Group Merge into the Linux Foundation

Sun, Intel Form Alliance for Xeon Servers and Workstations

IDC Says Global IT Spending Will Kiss $1.5 Trillion By 2010

The X Factor: Solaris Versus Linux Support Pricing

Four Hundred Stuff
IBM Lotus Adds Handles to Information Overload

Applied Logic Launches OS/400 Encryption Utility

BOSaNOVA Launches Four Thin Clients

GT Software Gives Web Service Smarts to Web-Enabled Apps

Big Iron
IBM Closes Out 2006 With a Strong Fourth Quarter

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
January 20, 2007: Volume 9, Number 3

January 13, 2007: Volume 9, Number 2

January 6, 2007: Volume 9, Number 1

December 30, 2006: Volume 8, Number 50

December 23, 2006: Volume 8, Number 49

December 16, 2006: Volume 8, Number 48

The Windows Observer
Microsoft Partners Begin Testing for Dynamics CRM 'Titan'

Aras Delivers Open Source PLM Software for Windows

Intel Delivers More Quad-Core Server and PC Chips

SGI and Microsoft Partner on Windows Supercomputer Clusters

The Unix Guardian
Sun Tapes Out Rock Sparc Chip, Gooses Clocks on Niagara Sparc T1

Sun Finally Gets Solaris 10 11/06 Update Out the Door

Unisys Broadens Oasis Open Source Software Stacks for Linux

Why the Number of Women in IT Is Decreasing

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

SEQUEL
WorksRight Software
VAULT400



TABLE OF CONTENTS
Using the SQL SET OPTION Statement

Legible PATH and CLASSPATH

Admin Alert: Updating Your System i5 for Daylight Saving Time Changes

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Scheduling a job to run in PASE

FTP from IFS folder

Populate fields with file

Compare source and object timestamps

Tracking spool file printing--pages printed, where printed





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement