Fix xargs writing race condition

This commit is contained in:
Brice Waegeneire 2020-10-06 12:12:37 +02:00
parent 096e04e61c
commit 7ba2130393

View file

@ -43,13 +43,13 @@ get_confs() {
cd - 1>/dev/null
}
# Find all the .htaccess uder each DocumentRoot
# Find all the .htaccess under each DocumentRoot
get_htaccess() {
xargs -P 0 \
xargs \
awk 'sub("^[[:space:]]*DocumentRoot[[:space:]]*", "")' \
< "$confs" \
| sort -u \
| xargs -P 0 -I _ find _ -name .htaccess || true
| xargs -I _ find _ -type f -name .htaccess || true
}
# Put different type of configs in different files