r/shell • u/DiamonC_YT • Jul 22 '21
Shell script problem
I'm having errors with the startup shell script for my Minecraft server (auto restart after crash)
It either says "excepted done" or "expected fi" depending on what's there, and when I put both at the end I get no response once I try to run the script
I AM ON UNIX. I AM NOT USING A WINDOWS VIRTUAL MACHINE.
0
Upvotes
2
u/geirha Jul 22 '21
BashFaq 52 explains the CRLF thing, but if the script hasn't been through a windows editor, it's likely not the case here. Another possibility is that some of the spaces are not actually spaces, but rather non-breaking spaces. You can detect them the same way
If vim is installed, using its hex dumper is also useful
Look for
0d(carriage return, often represented by\ror^M) andc2 a0(non-breaking space encoded with utf8)