./configure : /bin/sh^M : bad interpreter [duplica

2019-01-01 04:39发布

This question already has an answer here:

I've been trying to install lpng142 on my fed 12 system. Seems like a problem to me. I get this error

[root@localhost lpng142]# ./configure
bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
[root@localhost lpng142]# 

How do I fix this? The /etc/fstab file:

#
# /etc/fstab
# Created by anaconda on Wed May 26 18:12:05 2010
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=ce67cf79-22c3-45d4-8374-bd0075617cc8 /boot                   ext4    
defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

15条回答
栀子花@的思念
2楼-- · 2019-01-01 05:11

If you are using TextMate or a similar programme, do save as, and then in encodings choose LF instead of CRLF.

查看更多
倾城一夜雪
3楼-- · 2019-01-01 05:17

To fix, open your script with vi or vim and enter in vi command mode (key Esc), then type this:

:set fileformat=unix

Finally save it

:x! or :wq!

查看更多
高级女魔头
4楼-- · 2019-01-01 05:18

You can also do this in Kate.

  1. Open the file
  2. Open the Tools menu
  3. Expand the End Of Line submenu
  4. Select UNIX
  5. Save the file.
查看更多
登录 后发表回答