• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Legible PATH and CLASSPATH

    January 24, 2007 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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    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
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    Aras Delivers Open Source PLM Software The Vanishing IT Woman–System i Women Respond

    Leave a Reply Cancel reply

Volume 7, Number 3 -- January 24, 2007
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

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • To Comfort The Afflicted And Afflict The Comfortable
  • How FalconStor Is Reinventing Itself, And Why IBM Noticed
  • Guru: When Procedure Driven RPG Really Works
  • Vendors Fill In The Gaps With IBM’s New MFA Solution
  • IBM i PTF Guide, Volume 27, Number 27
  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle