Help running bash scripts
David Christensen
dpchrist@holgerdanske.com
Wed Nov 22 09:26:00 GMT 2006
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@s3000p ~
$ which bash
/usr/bin/bash
4. Try this:
2006-11-21 21:11:51 dpchrist@s3000p ~
$ vi foo.sh
#! /usr/bin/bash
echo foo
2006-11-21 21:16:39 dpchrist@s3000p ~
$ chmod +x foo.sh
2006-11-21 21:16:44 dpchrist@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/
More information about the Cygwin
mailing list