I have this code:
for f in $(find -E . -type f ! -regex ".*(zip|png|jpeg|jar|ear|ttf|jpg|git)") ! -path .git; do echo $'\nFile: '$f; sed "$(( $(wc -l <$f) / 2 ))"',$d' $f; done
And it seems to be working well. The problem is that if I change it to:
for f in $(find -E . -type f ! -regex ".*(zip|png|jpeg|jar|ear|ttf|jpg|git)") ! -path .git; do echo $'\nFile: '$f; sed -i "$(( $(wc -l <$f) / 2 ))"',$d' $f; done
Note the -i option in the sed command. I get this error:
sed: 1: "./some/path/ ...": invalid command code .