Re: Spurious warning generated by bash

Brian Inglis via Cygwin <[email protected]>
Newsgroups gmane.os.cygwin
Organization Systematic Software
Message-ID <[email protected]>
On 2025-12-31 19:20, Soren via Cygwin wrote:
> On Wed, Dec 31, 2025 at 7:59 PM Backwoods BC via Cygwin wrote:
>> On Wed, Dec 31, 2025 at 1:25 PM David Dyck via Cygwin wrote:
>>> On Wed, Dec 31, 2025 at 12:21 PM Soren via Cygwin wrote:

>>>>    ./list2str.sh: line 1: #!/bin/bash: No such file or directory

>>> nice perl script :-)

>>> I don't get the warning when the script is run from bash
>>> what context did you run the script from?

>> I suspect your source is UTF with a BOM tag. I created a file with
>> this and got your exact results. UTF is OK as long as it doesn't have
>> the BOM tag.

> Wow, yes.

> You are absolutely correct. I opened the script in vim and :set nobomb and
> the script now executes properly without the annoying noise. I needed the
> bomb for something to do with perl developing (it was a while ago), but
> I'll have to remember to set vim up so that it doesn't do that on scripts.
> Thank you VERY much and have a Happy New Year.

Running `file` is your friend - it tells you what junk may be in a file.

Running `d2u -i ...` gives more info, then 'd2u -e -f -r ...` fixes most issues.

Happy New Year and have a great 2026!

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.