Using cd in scripts


Subject: Using cd in scripts
From: John Kebbel (kebbelj@irwin.vetrol.com)
Date: Thu Jun 15 2000 - 10:10:38 MDT


        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 : Thu Jun 15 2000 - 10:05:11 MDT