www.delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <183c528b0707190749w7718c45ct5554302c9d92384c@mail.gmail.com> |
Date: | Thu, 19 Jul 2007 10:49:07 -0400 |
From: | "Brian Mathis" <brian DOT mathis AT gmail DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: How to run bash shell script in cygwin? |
In-Reply-To: | <469F7858.4010007@cygwin.com> |
MIME-Version: | 1.0 |
References: | <11690723 DOT post AT talk DOT nabble DOT com> <469F7858 DOT 4010007 AT cygwin DOT com> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On 7/19/07, Larry Hall (Cygwin) <reply-to-list-only-lh AT cygwin DOT com> wrote: > myuser01 wrote: > > I have a script called "batchjob" that looks like this: > > #!/bin/bash > > echo 'I was here' > > > > -rwxr-xr-x 1 c10066 mkpasswd 48 Jul 19 09:30 batchjob > > > > But when I try to execute it from the cygwin shell I get this: > > $ batchjob > > bash: batchjob: command not found > > > > How do i execute a bash shell script from within cygwin? > > This is not a Cygwin problem. It's a usage issue. You'd see > the same problem on other platforms. Try: > > ./batchjob > > -- > Larry Hall http://www.rfk.com ... and the reason for this is because the current directory, called "." (dot), is not normally in the PATH environment variable. This variable is used to find programs that you are trying to run. Since "." is not in that list, it will not find the script. Adding the "./" in front of the command name tells the shell to "look in this directory (.) for the command" You can read more about this by doing a google search like: http://www.google.com/search?q=path+environment+variable -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |