[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using cd is shell script



on Sun, Aug 26, 2001 at 05:26:36PM -0700, bob parker (bobparker38@yahoo.com) wrote:
> Hi all,
> being a lazy typist i have writen a little script that
> goes like this:
> 
> #! /bin/bash
> #     go-xxx where xxx is the last dir in along chain
> 
> cd /some long dir chain/xxx
> 
> 
> My question is, how can i make the change persist
> after the script is done

Write a function instead, and understand the difference between a script
and a function, an the impact on a process's environment.

Hint:  parents don't inherit from children.

-- 
Karsten M. Self <kmself@ix.netcom.com>          http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             There is no K5 cabal
  http://gestalt-system.sourceforge.net/               http://www.kuro5hin.org
   Free Dmitry! Boycott Adobe! Repeal the DMCA!    http://www.freesklyarov.org
Geek for Hire                        http://kmself.home.netcom.com/resume.html

Attachment: pgpscO4B19ZMd.pgp
Description: PGP signature


Reply to: