I have a file containing includes.
BASE_FILE :
#include "File1.hpp"
#include "Rep/File2.hpp"
I want to add these includes in another file (NEW_FILE). I wrote a script :
grep "$BASE_FILE" - "#include" | while read -r INC
if ! grep -q "$INC" "$NEW_FILE"
then
sed -i "1s/^/$INC/g" "$NEW_FILE"
fi
done
But I have error "wrong option for s". I don't know if my problem comes from the " or the / in my BASE_FILE.