Guild Companies, Inc.  
 
Midrange Guru - Tech Tips
OS/400 Edition
Volume 2, Number 29 - April 17, 2002

Show Current Directory in Qshell Prompt

Hey, Ted:

Back in my old MS-DOS days, the default prompt was something like a drive letter and a greater-than ( > ) sign. I don't remember the default because I never used it; I had a line in the autoexec.bat file that made the system include the current directory in the prompt.

Now I'm using the Qshell interpreter, and the prompt is a dollar ( $ ) sign. Is there a way to make the prompt show me the current directory?

-- Harmon

Yes there is. Create a file called .profile in your current directory. Add these two lines to it:

PS1='$PWD $'
export PS1  

The .profile file is similar to the MS-DOS autoexec.bat file. The commands within it run when you start Qshell. PS1 is a predefined variable that contains the primary Qshell prompt. By setting it to $PWD, the prompt displays the current directory. The export command is necessary to make the value of PS1 carry over into your interactive session.

Your prompt will look something like this:

/home/jsmith $

I learned this one from Heiner Steven's SHELLDorado Web site .

-- Ted

Sponsored By
TRAMENCO

Learn what's over the horizon for the iSeries and AS/400, and how it will impact your career, by attending the premier training event of 2002. It's the iSeries and AS/400 Connection Conference June 16 – 19, 2002 in Naples Florida. Join 19 of the industries greatest minds including Dr. Frank Soltis, Skip Marchesani, Wayne O. Evans, Susan Gantner, Jon Paris, Marie Finnegan-Cronin, and Howard Arner, Jr. as they deliver AS/400 training and education to prepare you for the challenges of tomorrow. A full agenda of 96 sessions (including 10 hands-on labs) provide practical instruction in a full range of topics, including:

  • Understanding Websphere Development Studio

  • Accessing DB2/400 data from Linux

  • Learning how JavaBeans are used

  • Make the most of RPG IV's built in functions

  • SQL Tricks and Techniques

  • ABCs of System Management

  • And much more!
Whether you are an old pro, or just getting your feet wet, there is something for everyone during this intensive four-day conference. Best of all, your classroom is the Registry Resort and Spa, Naples Florida's premier 5-star resort. To register, or for more information, call 1 800 897.5923, or go to the web at www.tramenco.com. But hurry, you must register before May 15, 2002 to save $200 off the standard registration and be eligible for special hotel rates.
THIS ISSUE
SPONSORED BY:
SoftLanding Systems
TRAMENCO
BACK ISSUES
TABLE OF CONTENTS
Installing the 1.3 Java Development Kit
Show Current Directory in Qshell Prompt
Reader Feedback and Insights: We Still Use the 'Old' Stuff
  Newsletters | Subscribe | Advertise | About Us | Contact | Search | Home  
  Last Updated: 4/17/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.