I am writing a Makefile, which will list all headers included by a.cpp, b.cpp and c.h files. However, I got the error of unexpected EOF. Similar questions are always caused by the line terminator, like they used CRLF instead of LF for an EOL. However, my Text editor was set to using LF and I recheck this by delete all EOL and re-added. Unfortunately, the error still remains. Here are the codes:
#!/bin/bash
list-header:
for file in a.cpp b.cpp b.h
do
echo "$file includes headers: "
grep -E '^#include' $file | cut -f2
done
I got this error message:
for file in "Bigram.cpp client.cpp Bigram.h"
/bin/sh: -c: line 1: syntax error: unexpected end of file"
Thanks in advance for any help.