Josef “Jeff” Sipek

chdir

This is probably as old as the internet itself…

Newsgroups: comp.unix.questions
Subject: NEED HELP FAST !!!!!!!!!
From: cs245@cs.somewhere.edu (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!!!!      cs245@cs.somewhere.edu                            |
 |                                                                            |
 +----------------------------------------------------------------------------+

1 Comments »

  1. This was written by me, somewhere around the timestamp in the message when I worked at EDS/Unigraphics Division. It was published in rec.humor.funny around the same time. Brad Templeton owns the copyright on stuff in rec.humor.funny, but if he is upset about having this fair use excerpt made from it, I'll sic the Hitler from Downfall on him.

    (I hope you enjoyed reading it as much as I enjoyed writing it)

    Comment by unknown — January 1, 1970 @ 00:00

Atom feed for comments on this post.

Leave a comment

Powered by blahgd