I'm trying to wirte a bash script that will dynamically construct the command I need to execute. (merging lcov files)
So far I'm able to construct the command line, here is the result:
#!/bin/bash
LCOV_INPUT_FILES=""
while read FILENAME; do
LCOV_INPUT_FILES="$LCOV_INPUT_FILES -a \"$FILENAME\""
done < <( find ../reports/coverage -name lcov.info )
echo lcov "${LCOV_INPUT_FILES}" -o ../reports/coverage.lcov
lcov "${LCOV_INPUT_FILES}" -o ../reports/coverage.lcov
If I run the line the echo
outputs in my shell it works, but I cannot run this command from my script, and I lack of bash greatness to debug it.
Here is the kind of output I get from the echo:
lcov -a "../reports/coverage/Chrome 26.0 (Linux)/lcov.info" -a "../reports/coverage/Firefox 20.0 (Linux)/lcov.info" -a "../reports/coverage/PhantomJS 1.8 (Linux)/lcov.info" -o ../reports/coverage.lcov
Do you know what could be wrong here?
Regards,
Xavier