delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/11/10:40:49

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BC5AF9B.5090003@earthlink.net>
Date: Thu, 11 Oct 2001 09:41:31 -0500
From: Jonathon Merz <jmerz42 AT earthlink DOT net>
Reply-To: jmerz42 AT earthlink DOT net
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4) Gecko/20010913
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin/Bash: Some builtins done work in scripts
References: <3BB9087F000058DB AT mail DOT epost DOT de>

Rainer Klute wrote:

> Hi,
> 
> I hope you are the right one to report a bug to I just encountered in Cygwin's
> bash: The builtins pushd, popd and dirs don't work when I use them in a
> script file. The error message is e.g. "pushd: not found". Other builtins,
> like "cd" work in scripts. At the tty the faulty builtins works fine. Its
> just in scripts. (Needless to say that under Unix (Linux) the buildins work
> in scripts.)
> 
> I am using Cygwin 1.3.2-1 and bash 2.05-6. The version number I extracted
> from the setup.log.


Make sure that you have #!/usr/bin/bash on the first line of your script.  I 
think that if you don't specifically use bash, scripts will be executed using 
sh, which does not have pushd, popd, or dirs as builtins.  The following 
script works fine for me, but if I change the 'bash' to 'sh' or remove the 
line all together, I get the "not found" errors.

#!/usr/bin/bash

pwd
pushd .
dirs
cd winnt
pwd
dirs
popd


-- 


-------------------------------------
  If you had a million Shakespeares,
  could they write like a monkey?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019