Re: Using cd in scripts


Subject: Re: Using cd in scripts
From: Paul J. Lucas (pjl@barefooters.org)
Date: Mon Jul 10 2000 - 07:20:56 MDT


        Repeat after me: child processes can not change the environment
        of their parents.

        The only way to do what you want is shell aliases.

        - Paul

On Thu, 15 Jun 2000, John Kebbel wrote:

> In my DOS days, I was able to jump all over with one-line DOS batch
> files to my PERL directory or my JAVA directory. I tried the same thing
> with Linux but with no luck.
>
> For example, from the command line
>
> cd /mnt/macAux
>
> will take me to a Macintosh drive accessible from Linux. When I try and
> put this line in a script, however, Linux/bash (or PERL) evaluates the
> line, but it's a round trip. I go to that directory (I've added extra
> lines that create files that prove I've been there), but I'm back where
> I started as soon as the file finishes executing. This would be a really
> handy tool: I could jump to my HTML, cgi-bin, Mac disk, floppy disk,
> etc. with just a few characters.
> I've tried PERL variations with eval and do, but with no luck. I've
> also tried using chdir in place of cd.
> Is there anybody using this technique who can tell me what I'm doing wrong?
>



This archive was generated by hypermail 2a24 : Mon Jul 10 2000 - 07:23:47 MDT