I am creating a shell file on the fly containing following commands
#!/bin/sh
gcc -Wall -c *.c
gcc -shared -o libr.so *.o
When I cd to that location and run the shell script using this command sh fun.sh, I am getting following error
sh fun.sh : No such file or directory
gcc: fatal error: no input files
compilation terminated.
Typing these commands one by one in the linux does the work but shell script is not working. Kindly help me out with this
fun.shhave DOS-style (CRLF) endings? Check withfile fun.sh.cfiles in that directory?:and with the full command at the start. It looks like the shell is saying it can't findgcc, but thengccis saying that it didn't get any input files (formatted in a way that only makes sense ifnullglobwas set in thebashshell, which, AFAICS, it is not).