• 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
    Computer Keyes

    Fax Directly from your IBM i

    KeyesFax is a full function automated IBM i fax system. Spooled files are burst by fax number and auto transmitted with overlays.  It combines both a send and receive facsimile processing system with a complete image package.

    The fax software will edit, send, receive, display, print, and track fax documents or images using any standard IBM i without additional expensive hardware, software or subscriptions.

    Computer Keyes has been developing Software Solutions since 1978!

    www.computerkeyes.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

  • 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
  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25

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