Closed psterk closed 5 years ago
The following line of code fails silently when the argument line becomes too long for ls:
if [[ ls -1 OUT*/*annotation.csv 2> /dev/null | wc -l -gt 0 ]]
ls -1 OUT*/*annotation.csv 2> /dev/null | wc -l
This can be fixed by using find/xargs instead of ls:
if [[ find OUT* -name "*annotation.csv" 2> /dev/null | wc -l -gt 0 ]]
find OUT* -name "*annotation.csv" 2> /dev/null | wc -l
Same with two occurrences of:
for i in $(ls -d OUT_/ annotation.csv)
Can be fixed as follows:
for i in $(find OUT_/ -name "annotation.csv")
Hi, thank you. Very well spotted! We have incorporated the fix you suggested.
https://github.com/mitoNGS/MToolBox/commit/a8293cd1b647e3fa498db8151660d4a965b382a0
Best, Claudia
The following line of code fails silently when the argument line becomes too long for ls:
if [[
ls -1 OUT*/*annotation.csv 2> /dev/null | wc -l
-gt 0 ]]This can be fixed by using find/xargs instead of ls:
if [[
find OUT* -name "*annotation.csv" 2> /dev/null | wc -l
-gt 0 ]]Same with two occurrences of:
for i in $(ls -d OUT_/ annotation.csv)
Can be fixed as follows:
for i in $(find OUT_/ -name "annotation.csv")