I'm new to bash and can't seem to get it to compile some C code without annoying messages. I'm quote sure it's the semicolons because if I remove or change them at all it will pretty much break. The warnings/errors I get are ": not found: :" with nothing else repeatedly for every line. Any help is appreciated.
#!/bin/bash GCC=/usr/bin/gcc ; INSERTS="10000 20000 50000 100000 150000 250000 375000 500000 750000 1000000" CODESRC=./code.c; #compile with options $GCC -DDEBUG -o codetest $CODESRC; #run with parameters ./codetest $INSERTS;
The code compiles and runs fine. If I remove all the semicolons and try to run it using
sh test.sh I get the following.
test.sh: 6: /usr/bin/gcc : not found test.sh: 8: ./codetest: not found
Ahh, silly me; it was a windows/unix line endings problem, became apparent when running ./test.sh and getting
/bin/bash^M: bad interpreter