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
share|edit|flag

5 Answers

up vote 31 down vote accepted

Looks like you have a dos line ending file. The clue is the ^M

You need to re-save the file using Unix line endings.

You might have a dos2unix command line utility that will also do this for you.

share|edit|flag
  upvote
 flag
Yes, the ^M kinda seemed weird. I did see this dos2unix configure suggestion somewhere in the net, but didn't wanna run into other problems. Okay, fingers crossed, i'll give it a try :) Thanks for the quick replies, Konerak and Richard – Vineeth May 27 '10 at 12:30
  upvote
 flag
Thank you! I couldn't figure out why my cron job stopped working... That fixed it, but I don't remember editing it in Windows. – RegionalC Oct 26 at 19:24

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!

share|edit|flag

Your configure file contains CRLF line endings (windows style) instead of simple LF line endings (unix style). Did you transfer it using FTP mode ASCII from Windows?

You can use

dos2unix configure

to fix this, or open it in vi and use :%s/^M//g; to substitute them all (use CTRL+V, CTRL+M to get the ^M)

share|edit|flag
  upvote
 flag
Nope, I did use linux to download the .gz file. No idea how CRLF got there. – Vineeth May 27 '10 at 12:33
  upvote
 flag
vim search and replace that's easier to type: %s/r$//g – glenn jackman May 27 '10 at 15:35

Or if you want to do this with a script:

sed -i 's/r//' filename
share|edit|flag

If you're on OS X, you can change line endings in XCode by opening the file and selecting the

View -> Text -> Line Endings -> Unix

menu item, then Save. This is for XCode 3.x. Probably something similar in XCode 4.

share|edit|flag

Your Answer

  • Images are exactly like links, but they have an exclamation point in front of them:

    ![a busy cat](http://sstatic.net/stackoverflow/img/error-lolcat-problemz.jpg)
    ![two muppets][1]
    
     [1]: http://i.imgur.com/I5DFV.jpg "tooltip"
    

    The word in square brackets is the alt text, which gets displayed if the browser can't show the image. Be sure to include meaningful alt text for screen-reading software.

    Be sure to use text styling sparingly; only where it helps readability.

    *This is italicized*, and so
    is _this_.
    
    **This is bold**, just like __this__.
    
    You can ***combine*** them
    if you ___really have to___.
    

    To break your text into sections, you can use headers:

    A Large Header
    ==============
    
    Smaller Subheader
    -----------------
    

    Use hash marks if you need several levels of headers:

    # Header 1 #
    ## Header 2 ##
    ### Header 3 ###
    

    Both bulleted and numbered lists are possible:

    - Use a minus sign for a bullet
    + Or plus sign
    * Or an asterisk
    
    1. Numbered lists are easy
    2. Markdown keeps track of
       the numbers for you
    7. So this will be item 3.
    
    1. Lists in a list item:
        - Indented four spaces.
            * indented eight spaces.
        - Four spaces again.
    2.  You can have multiple
        paragraphs in a list items.
     
        Just be sure to indent.
    
    > Create a blockquote by
    > prepending “>” to each line.
    >
    > Other formatting also works here, e.g.
    >
    > 1. Lists or
    > 2. Headings:
    >
    > ## Quoted Heading ##
                

    You can even put blockquotes in blockquotes:

    > A standard blockquote is indented
    > > A nested blockquote is indented more
    > > > > You can nest to any depth.
    

    To create code blocks or other preformatted text, indent by four spaces:

        This will be displayed in a monospaced font. The first four spaces
        will be stripped off, but all other whitespace will be preserved.
        
        Markdown and HTML are turned off in code blocks:
        <i>This is not italic</i>, and [this is not a link](http://example.com)
    

    To create not a block, but an inline code span, use backticks:

    Press the `<Tab>` key, then type a `$`.
    

    If you want to have a preformatted block within a list, indent by eight spaces:

    1. This is normal text.
    2. So is this, but now follows a code block:
     
            Skip a line and indent eight spaces.
            That's four spaces for the list
            and four to trigger the code block.
    

    If you need to do something that Markdown can't handle, use HTML. Note that we only support a very strict subset of HTML!

    Strikethrough humor is <strike>funny</strike>.
    

    Markdown is smart enough not to mangle your span-level HTML:

    <b>Markdown works *fine* in here.</b>
    

    Block-level HTML elements have a few restrictions:

    1. They must be separated from surrounding text by blank lines.
    2. The begin and end tags of the outermost block element must not be indented.
    3. Markdown can't be used within HTML blocks.

    <pre>
        You can <em>not</em> use Markdown in here.
    </pre>
    
 

Not the answer you're looking for? Browse other questions tagged or ask your own question.