Given the mention of CRs + dos2unix and 'but today im both building
and running the script on linux', would that mean you were doing it on
Windows originally? When then 'on Linux' subsequently, might that have
been e.g under WSL and accessing repo files originally checked out
from the host? Alternatively, have you played with the eol / autocrlf
settings perhaps?

I dont think any of the typical contributors develops on Windows, so
neither the build or the repository settings really take [m]any steps
to account for line endings. For most of us everything typically
appears to be just running on Linux with the git defaults which
typically results in LF in the repo and thus LF checkouts for most,
unless git is configured otherwise .

If I run "git ls-files --eol
artemis-distribution/src/main/resources/bin/artemis" it shows the
index and working dir file using LF.

$ git ls-files --eol artemis-distribution/src/main/resources/bin/artemis
i/lf    w/lf    attr/
artemis-distribution/src/main/resources/bin/artemis

I expect if you run it, the result will be different, e.g w/crlf

(There does look to be 5 files in the repo with CRLF endings in total,
probably originally committed by someone running on Windows, or from
someone copy/pasting a file or bit of content originally with CRLFs)

We could possibly tweak the assembly build to set the endings on those
files, or commit a .gitattributes to control the checkout, to avoid
the issue you are hitting...it's just not really come up before so
there hasnt really been any need to consider it.

On Tue, 4 Nov 2025 at 08:46, Gašper Čefarin <[email protected]> wrote:
>
> I'm not sure if i'm the only one, but i experience these errors when building 
> the distribution packages, unzipping and running the "artemis" script.
>
> running artemis extracted from .tar.gz:
>
> artemis: line 18: $'\r': command not found
> artemis: line 54: syntax error near unexpected token `$'in\r''
> 'rtemis: line 54: `case "`uname`" in
>
> from .zip:
> /usr/bin/env: ‘sh\r’: No such file or directory
>
>
> yesterday I solved it with running dos2unix:
>
> xx:/tmp/artemis/apache-artemis-2.45.0-SNAPSHOT/bin$ ./artemis create broker 
> --force
> /usr/bin/env: ‘sh\r’: No such file or directory
> xx:/tmp/artemis/apache-artemis-2.45.0-SNAPSHOT/bin$ dos2unix artemis
> dos2unix: converting file artemis to Unix format...
> xx:/tmp/artemis/apache-artemis-2.45.0-SNAPSHOT/bin$ ./artemis create broker 
> --force
> Creating ActiveMQ Artemis instance at: 
> /tmp/artemis/apache-artemis-2.45.0-SNAPSHOT/bin/broker
> ...
>
>
>
> but today im both building and running the script on linux (ubuntu 24), and 
> i'm experiencing the same problems. Can anyone else confirm that this is an 
> actual issue?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to