Syntax error: "("和 /bin/sh^M: bad interpreter
本帖最后由 molaifeng 于 2012-10-25 21:21:50 编辑 弄了个ubuntu系统,捣鼓着shell,可是尽是拦路虎,先是在vim下输入个方法,运行时出现
Syntax error: "("
/bin/sh^M: bad interpreter: No such file or directory
root@xushaolong-virtual-machine:/mnt/hgfs/ubuntu# ./a
bash: ./a: /bin/sh^M: bad interpreter: No such file or directory
root@xushaolong-virtual-machine:/mnt/hgfs/ubuntu# dos2unix a
dos2unix: converting file a to Unix format ...
root@xushaolong-virtual-machine:/mnt/hgfs/ubuntu# ./a
./a: 2: ./a: Syntax error: "(" unexpected
root@xushaolong-virtual-machine:/mnt/hgfs/ubuntu#
#!/bin/sh
function test()
{
echo 1
}