home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!paladin.american.edu!gatech!swrinde!cs.utexas.edu!wupost!csus.edu!netcom.com!dman
- From: dman@netcom.com (Dallman Ross)
- Subject: Re: looking a utility to chdir without typing full path
- Message-ID: <1993Jan9.000845.15937@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- X-Newsreader: TIN [version 1.1 PL8]
- References: <1ikvt1INNqq2@usenet.INS.CWRU.Edu>
- Date: Sat, 9 Jan 1993 00:08:45 GMT
- Lines: 66
-
- Wei Jin Mai (cl820@cleveland.Freenet.Edu) wrote:
-
- > I just switch to Unix from Dos. Is there a utility or shell that let you
- > change directory without typing full path? For example: chdir abc changes
- > working directory to /usr/local/src/abc .
- > --
-
- There are many ways to do this. There are also a number of commercial
- utilities that provide for this, the preeminent one probably being Norton.
-
- But you can very easily write your own little batch files to do the same
- thing. Before I say more on that, I might mention that you can save your-
- self a lot of keystrokes by realizing that "cd" does exactly the same
- thing as "chdir."
-
- Now for a batch-file example. I have a subdirectory called BAT where
- I keep all of my batch files, and it's in my path; but you can put
- them anywhere they'll be found by your path.
-
- Example of batch file to simplify changing dir's to
- C:\APPS\TEXTAPPS\WP51\WORK\LETTERS\BUSINESS (believe it or not, a
- real subdirectory on my computer):
-
- ------------
- @echo off
- c:
- cd \apps\textapps\wp51\work\letters\business
- ------------
-
- Use what's between the lines, and save it as, for example, WORK.BAT in
- the appropriate active directory. Then, from any DOS prompt, you would
- just type "work" -- no need for even the "cd" referred to in the initial
- paragraphs -- and you'll be in the right directory.
-
- That said, if you're not using a shell front to DOS and you're not using
- Windows, you still should rarely need to change directories manually.
- By making all your main applications active (in your path in AUTOEXEC.BAT)
- and by making batch files for the lesser-used ones, you will find that
- "cd" is a rare command indeed.
-
- I run many of my apps from batch files rather than making all my program
- paths executable. Here would be one for WordPerfect:
-
- ----------
- @echo off
- c:
- cd \apps\textapps\wp51\wp
- cd \
- ----------
-
- The reason I have the extra "cd \" at the end is to "clean up" by reverting
- to the root directory when I leave WordPerfect. The batch file is still
- active the whole time I'm in WP, waiting for the exit, and then it
- puts me back in root.
-
- WP51 has a feature whereby you can set up a default active-work directory,
- and I use that feature. In another program, I might use the batch
- file to first move me to the proper subdirectory before initiating the
- program-executable.
-
- --
- __D_a l_l m a_n _ R o_s s _ |dman@netcom.com /or/ |"You sound like a man|
- l \\ l\\ /l /\\ l\\ l |dross@well.sf.ca.us |with a rubber nose." |
- l >)l \\ /ll / \\ l \\ l |vox/fax: 1.510.645.1883| -- One-Lung Bill |
- l // l \X ll/--- \\l \\ l |350 Perkins St., #108 | Remmer (deceased)
- _l//______________________\\l_|Oakland,_CA__94610-3422|_____________________|_
-