#!/bin/bash and #1bin/sh command not found error on mac osx terminal/shell script

i am having a weird error on mac os x running some shell scripts. i am a complete newbie at this and this question concerns 2 scripts. one of which a friend of mine wrote (videochecker.sh) a couple weeks ago and it's been running fine on another machine.

then last week i wrote capture.sh and it has been running fine on a couple computers.
but then i tried to run videochecker.sh on a new machine that runs capture.sh fine and i got the following error:

: No such file or directory#!/bin/bash

why will one script(capture.sh) execute fine and the other (videochecker.sh) gives this weird bash error?
but then i saw they had different first lines.

one is /bin/sh and one is /bin/bash

weird thing to because the one that doesn't work on this machine (/bin/bash) has been working fine on the other broadcaster mac min for several weeks. scripts still very mysterious to me.

so i change it so #!/bin/sh and #! /bin/sh still no go...

: No such file or directory#!/bin/sh
: command not foundline 2: 
: command not foundline 5: 
: command not foundline 7: 
: command not foundline 9: 
'/videochecker.sh: line 72: syntax error near unexpected token `do
'/videochecker.sh: line 72: `for f in *.mp4; do 

another thing i tried as suggested:

bash -ex ./videochecker.sh
' '#!/bin/sh
: No such file or directory#!/bin/sh
Clarence$ bash -ex ./videochecker.sh
' '#!/bin/bash
: No such file or directory#!/bin/bash
Clarence$ echo $SHELL
/bin/bash                                                                 

two screenshots of terminal and some other discussion of the error
weird bash not found error in mac terminal on Flickr - Photo Sharing!
scripting error, #!/bin/bash not found? on Flickr - Photo Sharing!

anybody have any ideas here? sorry if i posted in wrong place. wasn't sure if this was a scripting problem or a mac os x problem.

thanks,
dan

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

If the file was created on a Windows box (or anywhere that doesn't use UNIX line endings), remove the carriage return from the end of each line.