From owner-freebsd-questions Fri Sep 13 13:00:38 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA12793 for questions-outgoing; Fri, 13 Sep 1996 13:00:38 -0700 (PDT) Received: from gatekeeper.fsl.noaa.gov (gatekeeper.fsl.noaa.gov [137.75.131.181]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA12788 for ; Fri, 13 Sep 1996 13:00:34 -0700 (PDT) Received: from emu.fsl.noaa.gov (kelly@emu.fsl.noaa.gov [137.75.60.32]) by gatekeeper.fsl.noaa.gov (8.7.5/8.7.3) with ESMTP id UAA12200; Fri, 13 Sep 1996 20:00:33 GMT Message-Id: <199609132000.UAA12200@gatekeeper.fsl.noaa.gov> Received: by emu.fsl.noaa.gov (1.40.112.4/16.2) id AA123784846; Fri, 13 Sep 1996 14:00:46 -0600 Date: Fri, 13 Sep 1996 14:00:46 -0600 From: Sean Kelly To: hmmm@alaska.net Cc: freebsd-questions@freebsd.org In-Reply-To: <323A122F.34B@alaska.net> (message from hmmm on Fri, 13 Sep 1996 19:02:23 -0700) Subject: Re: several Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> hmmm writes: > 1. how do you execute a sh cmd in a script - in your login shell? > i'd like to "cd" in a script, and i want to be "there" when the > script ends. It's impossible because a script runs as a separate process and each process has its own working directory. But, if the shell itself executed the script, rather than as a separate process, then it's possible. If you're running csh/tcsh, do: source and should be a csh script. If you're running sh/ksh, do: . (note the space after the dot) and here, should be a Bourne script. In either case, the commands in are executed by the current shell instead of in a subprocess. Yet another alternative is for the to print to standard output the name of the directory you want to end up in; then you just have to do: cd `` Now, can be any kind of script and it can be run from either kind of shell. > 3. why do i see so many "xerox"ed messages here? i like 2 for the > price of 1, except when it comes to e.mail! :) Heh, heh ... it's because when I reply to your message, your email address is in the `To:' list, so you see a copy right away. But then `freebsd-questions' is the the `Cc:' list, and since you're on the freebsd-questions list, you get a second copy at a later time. :-) --k