I guess this is a simple question but I seem to be able to understand why this is incorrect.
#!/bin/sh
header=`cat header.txt`
find . -name "*.go" -exec sed -i "" -e "1s|^|$header|" {} \;
This piece of script should add the content of header.txt to all .go files. But instead it outputs: sed: 1: "./restapi/operations/su ...": invalid command code .
I have found this answer, but the issue is still there.