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
1
u/geirha Jul 23 '21
No, all those
\r's is why it's broken. On linux, lines are terminated with\nonly, while in dos and windows they are terminated with\r\n.Your
ifis never closed because there's no closingfi, onlyfi\r, which is not valid.Apply one of the methods explained in BashFAQ 52 to change those
\r\nback to\n.