Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <378E8996.F476B541@geekspace.com> Date: Thu, 15 Jul 1999 21:23:34 -0400 From: Joshua Rosen Organization: GEEKS X-Mailer: Mozilla 4.61 [en] (WinNT; U) X-Accept-Language: en,ja,no MIME-Version: 1.0 To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: bash: pushd References: <378E8172 DOT 42692CCB AT dgs DOT monash DOT edu DOT au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Brendan Simon wrote: > > It seems that pushd is not in the path when you run your script. > Try putting "echo $PATH" in your script to see what the path is set to > when the script is exectued. `pushd' is a BASH built-in command, though--not an external programme, so the value of $PATH shouldn't matter, so long as you're getting bash. Oh! I've solved it-- Note that, if I do echo foo > a `./a' gives `foo: not found'. Also note that *./a is not listed as being executable*. If we do this, however: echo '#!'"$(type -p sh) foo " > b ..., then we note that `./b' will actuall run `foo', and spit out whatever the result of doing so is. We also notice that `ls -l b' shows b as executable!:) If you do run into problems with the $PATH or some other variable not being correctly known by a shell script, use `env', ie: check the output of this: echo '#!'"$(type -p env) sh pushd foo " Direct said output into a file, find that Cygwin recognises the file as being executable (because of the hashbang), and `pushd foo' (or whatever else is there) is executed with the current environment, after `sh' is found in the current PATH. -Rozzin. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com