Q:

error occurs when executing the first row of linux bash scripts

We use notepad++ v6.4.5 to edit Bash scripts in Chinese Windows XP sp3. The coding format is UTF-8 without BOM. The first line source is as below:
#!/bin/sh

The source is executed on Centos 6.4 (Linux, LANG=en_US.UTF-8). However, we got the following error message :
for242.sh: line 1: 锘?!/bin/sh: No such file or directory

Could you help us? Thanks a lot. The Centos linux is configured as follows:
[root@centos64 ]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

A:

It looks like there is a BOM at the start of the file anyway. This is standard on Windows. You can remove the UTF-8 BOM with dos2unix, if you have dos2unix version 6.0.0 or higher. If you do not have this version of dos2unix you can build it yourself. Get it from http://sourceforge.net/projects/dos2unix/
regards,

