2

I am trying to host a unturned server, and I watched a tutorial on youtube.

So that is what I wrote in textedit for the launcher of the server (a .command) :

#!/BIN/BASH
/Users/username/Desktop/Unturned/Unturned.app/Contents/MacOS/Unturned -nogui -batchmode +secureserver/ServeurQC

btw, I called the file (Unturned Serveur.command) without the ()

but it is giving me this error :

-bash: /Users/username/Desktop/Unturned Serveur.command: /BIN/BASH^M: bad interpreter: No such file or directory

logout

can someone help me.

3
  • This does not look like a command.
    – Pilot6
    Commented Jul 6, 2015 at 20:32
  • 1
    I voted to close this question since this site is about Ubuntu, and your question is about Mac OS. You can ask Mac OS questions on Ask Different or on Unix & Linux. However, to quickly address your issue, Unix systems are case-sensitive, hence the path to bash is so also: #!/bin/bash [...].
    – kos
    Commented Jul 6, 2015 at 20:39
  • Plus what heemayl stated in its answer, you are probably using an old (non-OSX) Mac OS-style line break, which uses carriage returns in place of line feeds.
    – kos
    Commented Jul 6, 2015 at 20:56

1 Answer 1

4

You are getting the error :

/BIN/BASH^M: bad interpreter: No such file or directory

because there is no file named /BIN/BASH in Linux systems (unless you create one yourself). All Linux systems are case-sensitive, so #!/bin/bash and #!/BIN/BASH are totally different.

To solve the interpreter related issue, make the shebang as :

#!/bin/bash

Or prefarably :

#!/usr/bin/env bash

Also you seems to have carriage return as your line terminator, but Linux systems use line feed to terminate lines. So you should correct it yourself or use a simple program line dos2unix to do the job.

You can simply do the conversion by :

dos2unix filename

It is not installed by default, you can install it by :

sudo apt-get install dos2unix
7
  • 1
    I do not think this is the only problem. There is also <CR> symbol there.
    – Pilot6
    Commented Jul 6, 2015 at 20:37
  • 1
    Unix systems, you probably didn't notice but OP is using Mac OS ;)
    – kos
    Commented Jul 6, 2015 at 20:42
  • @Pilot6 fixed..
    – heemayl
    Commented Jul 6, 2015 at 20:45
  • 1
    @kos my bad..i did not notice the BIG MAC :D
    – heemayl
    Commented Jul 6, 2015 at 20:46
  • I am not on linux
    – TheKiller
    Commented Jul 6, 2015 at 20:59

Not the answer you're looking for? Browse other questions tagged .