This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin/Bash: Some builtins done work in scripts

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.


pushd .
cd winnt


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

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]