#!/bin/bash
(called a shebang, short for Crash (#
) Bang (!
), tells the shell which program to use to execute the script in question. You'll see this with perl scripts (#!/usr/bin/perl
), Python (#!/usr/bin/python
), or php (#!/usr/bin/php
) as well.
In your situation, a few things could be causing it. Either the 'bash' shell is not installed or the script is in an unrecognized format that you can't see.
First, does bash exist? Give us the results of this: ls -l /bin/bash
Second, what is in the script? Give us the first 2 lines of this: od -c build.sh
What we're looking for is the script being in the wrong format. Windows likes CRLF'
or \r\n
for a line ending while Linux only likes LF
or \n
(see also: http://en.wikipedia.org/wiki/Newline)
To be honest, I don't know if CYGWIN likes Windows line endings or Linux, but that's a very likely cause for your issue.
Again, give us the output of od -c build.sh
and we'll see what's up.
Is bash in
/bin
? Is it executable (chmod +x /bin/bash)? – zero2cx – 2012-10-05T21:46:01.720I did it, yeah which bash is giving
/usr/bin/bash
– elbek – 2012-10-05T21:46:54.230