Awesome UNIX chdir program

dflood Computer Humour 0 Comments

Path: athena.cs.uga.edu!emory!swrinde!zaphod.mps.ohio-state.edu!uunet.ca!xenitec!looking!funny-request
From: [email protected] (Steve Baur)
Newsgroups: rec.humor.funny
Subject: NEED HELP FAST !!!!!!!!!
Keywords: original, computer, smirk
Message-ID: [[email protected]]
Date: 12 Jul 92 23:30:04 GMT
Lines: 58
Approved: [email protected]

This composition is original, although the subject is not.
--------------------------- Cut Here---------------------------------
Newsgroups: comp.unix.questions
Subject: NEED HELP FAST !!!!!!!!!
From: [email protected] (The Unknown Hacker)
Date: 7 Apr 92 12:55:45 EDT
Organization: UNIX Guru's R Us!


HI, EVERYBODY!!!!
Sorry if this is a FAQ, but I've heard that a FAQ is something
everybody already knows, but since I don't know the answer to this
everybody doesn't know it, so it can't be a FAQ, so here I go ...

I've just created about the most Awesome change directory program ever
written. If it doesn't find the target directory through an
exhaustive CDPATH search, it uses the most sophisticated spelling
corrector (based on a thorough analysis of Webster's on-line
dictionary, and a list of the 1000 most common directory names on Unix
systems throughout the world) to try to find a match that way. If
that fails, then it tries to create the directory, and if that fails,
it opens /dev/uri-geller, and reads the mind of the invoker to try to
figure out what to do. It executes with almost 0 impact on system
resources, and is most truly the finest/tightest code ever to grace
the memory of a computer.

The only problem is that it doesn't work. No matter how I've tried,
once I've done that last chdir (and I've tried doing several identical
chdir(2)'s in a row to see if that would make the directory change
more "sticky" but that didn't work) I always end up where I started in
the shell I started my program in. I've tried setting the PWD, and
CWD variables with putenv(3), but that doesn't seem to have any effect.

What it really seems to me, is I need some way of telling the shell what
directory it's supposed to be in when my program is done executing.
Put more simply, I need a way of modifying the environment of a parent
process.

E-mail responses only. There's too much noise on this bboard for me to
be able to read it. And HURRY!!! I need to turn this project in by 5pm
tonight !!!!

 +----------------------------------------------------------------------------+
 | _ /| |
 | \'o.O' UNIX Guru in training |
 | =(___)= |
 | U Joe Programmer |
 | ACK.. THPPT!!!! [email protected] |
 | |
 +----------------------------------------------------------------------------+

--
- Steve [email protected] (236/607 4/1/92)
--

Leave a Reply