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 [EMAIL PROTECTED] ~
        $ which bash
        /usr/bin/bash


4.  Try this:

        2006-11-21 21:11:51 [EMAIL PROTECTED] ~
        $ vi foo.sh
        #! /usr/bin/bash
        echo foo

        2006-11-21 21:16:39 [EMAIL PROTECTED] ~
        $ chmod +x foo.sh

        2006-11-21 21:16:44 [EMAIL PROTECTED] ~
        $ ./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/

Reply via email to