Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 4, Number 37 -- November 3, 2004

Qshell Logout Script

Hey, Ted:


I know about the special scripts that run automatically when I begin a Qshell session. Is there a way to make Qshell run a script when I end a session?

--Matt


Qshell does not support an automatic logout script, but you can tell Qshell to run a script when the session ends by trapping the EXIT pseudo signal.

Suppose you want to keep a log of your Qshell sessions. You might create an IFS file to contain the log information. The following command creates a file called qsh session history.

touch 'qsh session history'

Using the text editor of your choice, add the following lines to the .profile file.

echo "$LOGNAME logged in $(date)"  >> 'qsh session history'
trap '. $HOME/logoff.qsh' EXIT

The echo command writes your user name and current date and time to the qsh session history file. The trap command tells Qshell to execute the logoff.qsh script, which is in your home directory, in the current process when the session ends. By the way, you can use the number 0 (zero) instead of the word EXIT if you prefer.

After saving the changes to your .profile file, key the following command into a file called logoff.qsh in your home directory.

echo "$LOGNAME logged out $(date)"  >> 'qsh session history'

This command writes the date and time when you end a Qshell session to the qsh session history file. The result is a file that looks like this:

THOLT logged in Wed Nov 3 13:07:20  2004
THOLT logged out Wed Nov 3 13:15:18  2004
THOLT logged in Wed Nov 3 16:27:26  2004

--Ted


Click here to contact Ted Holt by e-mail.

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


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, 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.


THIS ISSUE
SPONSORED BY:

Profound Logic Software
WorksRight Software
Guild Companies


BACK ISSUES

TABLE OF
CONTENTS
A Different Perspective on WDSc

Qshell Logout Script

Admin Alert: Safely Deleting a User Profile


The Four Hundred
iSeries High Availability Should Be Integrated and Invisible

IBM Offers Trade-In Deal for Model 270 Shops

Keeping i5s Current Means Updating Firmware, Too

Four Hundred Stuff
U.S.A. Gets New OS/400 Systems Management Suite from SEA

Stampede's Web Performance Software Goes to Market

Visara Launches ICON Line for Console Consolidation

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement