X-Spam-Check-By: sourceware.org From: "David Christensen" To: "'cygwin'" Subject: RE: Help running bash scripts Date: Tue, 21 Nov 2006 21:24:22 -0800 Message-ID: <001301c70df6$77e7e2f0$0a00a8c0@s3000p> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: <4563C192.1020307@DeFaria.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 Thierry wrote: > running a simple sh script(test.sh): > #!/bin/sh > # test > $ ./test.sh > : command not found Get this book: http://www.oreilly.com/catalog/bash3/index.html "test" is a Bash built-in command ("man bash"; see CONDITIONAL EXPRESSIONS). Avoid using that keyword in Bash scripts and anywhere else Bash might trip over it (such as script and program names). So: 1. Rename your script. 2. Make it executable. 3. Adjust your shebang line to point to Bash. This is the location on my Cygwin system: 2006-11-21 21:11:50 dpchrist AT s3000p ~ $ which bash /usr/bin/bash 4. Try this: 2006-11-21 21:11:51 dpchrist AT s3000p ~ $ vi foo.sh #! /usr/bin/bash echo foo 2006-11-21 21:16:39 dpchrist AT s3000p ~ $ chmod +x foo.sh 2006-11-21 21:16:44 dpchrist AT s3000p ~ $ ./foo.sh foo HTH, David -- 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/