I've been trying to write a really simple bash script as follows:
#!/bin/bash
gcc –Werror –std=c99 client.c –o client
gcc –Werror –std=c99 server.c –o server
Each of the commands works fine when input manually, but from the scripts it treats each of the flags as a standalone command, resulting in the following output:
[elad@localhost HW1]$ ./compile
gcc: –Werror: No such file or directory
gcc: –std=c99: No such file or directory
gcc: –o: No such file or directory
gcc: –Werror: No such file or directory
gcc: –std=c99: No such file or directory
gcc: –o: No such file or directory
[elad@localhost HW1]$
I'm using a weird specialized RedHat distro provided by my university.