X-Spam-Check-By: sourceware.org Message-ID: <183c528b0707190749w7718c45ct5554302c9d92384c@mail.gmail.com> Date: Thu, 19 Jul 2007 10:49:07 -0400 From: "Brian Mathis" 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 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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) 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/