Thank you very much for your answers. As I thought, it seems that it isn't a problem of line endings. I run the script through od and I get the following:

$ head -1 edit_abi.pl | od -c 0000000 357 273 277 # ! / u s r / b i n / p e 0000020 r l \n

However, there are those odd (for me) numbers, 357 273 277 before the shebang text. What could that be? I think that this could be what is giving me the problem.

I am using the TextWrangler editor for writing the scripts, which is the light version of BBEdit.

UPDATE!

I solved the problem. Given the "odd numbers" that appeared at the beginning of the file when I run it through od, I searched what they meant and I learnt that \357\273\277 is the Byte Order Mark (BOM) for UTF-8, the encoding I was using. The text editor was just adding that invisible sequence automatically. So, I changed the encoding to UTF-8 whitout BOM (available in this text editor) and now the scripts run as expected.

I hope this can help other people. And thank you very much for your help, it was really very useful (I didn't know od, nor what hexadecimal dumper meant). Roger


In reply to Re: running scripts in Mac OS 10.4 by rogerd
in thread running scripts in Mac OS 10.4 by rogerd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.