I wrote the following script:for filename in `find . -name '*'.cpp | grep $IN_REGEX | grep -v $OUT_REGEX`do    echo Output file is $OUTPUT_FILE    count=`git log --pretty=format: --name-only $filename | grep -v ^$ | wc -l`    echo $count    $filename >> $OUTPUT_FILEdoneBut nothing gets written into the output file.Please note:I have set the values for OUTPUT_FILE, IN_REGEX and OUT_REGEX.The code inside the loop is being executed. I checked this with an sh -x invokation.When I remove the >> $OUTPUT_FILE I get the output. I tried a touch $OUTPUT_FILE inside the script and that is working fine.Can someone please point out what is my mistake here?
echo string >> file does not work
bash;io redirection;echo