Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <1991May20.223923.25963@convex.com> Date: 20 May 91 22:39:23 GMT References: <1991May20.155136.25162@ux1.cso.uiuc.edu> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 19 Nntp-Posting-Host: pixel.convex.com From the keyboard of ceblair@ux1.cso.uiuc.edu (Charles Blair): : : I would like to get to a directory /me/A/B/C/D by just typing j. I tried :creating a file j with cd /me/etc in it, then chmod +x j. It didn't work. :Thanks in advance. I'm sure I'm overlooking something well-known. Like your nice value, uid, and umask, your current working directory is an attribute associated with a given process. They are all inherited by child processes, but changes in children are not propagated back up to the calling parent process. That means a cd in a child is not reflected in the parent. You need to coerce the parent into doing this itself, as in: alias j='cd /me/A/B/C/D' --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."