Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bria!mike Newsgroups: comp.unix.questions Subject: Re: cd function Message-ID: <460@bria> Date: 18 Feb 91 00:05:54 GMT References: <2PyFX1w163w@wvus.wciu.edu> Reply-To: uunet!bria!mike Organization: MGI Group International, Los Angeles, CA Lines: 30 In an article, wvus.wciu.edu!pete (Pete Gregory) writes: >My login shell is /bin/sh (I guess I should say I'm running AT&T V.3.2, >actually Unisys PTX 1.1.1 for those who care), and I want my prompt >to include my current working directory. Well, unless your version of the shell allows a builtin function to be superceded, or you have the source (example: BaSH) then you have to resort to ugliness. WARNING: Ugliness is to follow. If you are easily offended by ugly kludges to routine problems, do not proceed further. Take your favorite binary editor (or use adb if you're hard-up), and walk through the binary for /bin/sh; replace 'cd' with 'xx'. Then your function will work ... cd() { xx $* PS1="`pwd`> " } Yep. I told you it was ugly. Cheers, -- Michael Stefanik, MGI Inc., Los Angeles| Opinions stated are not even my own. Title of the week: Systems Engineer | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- Remember folks: If you can't flame MS-DOS, then what _can_ you flame?