IMP(shellcheck): replace ls parsing by stat

This commit is contained in:
Thibault Ayanides
2020-12-14 16:14:37 +01:00
parent cdaee7786a
commit f4ba90352b
6 changed files with 13 additions and 10 deletions

View File

@ -30,7 +30,7 @@ audit() {
if test -d "$FILE_SEARCHED"; then
debug "$FILE_SEARCHED is a directory"
for file_in_dir in "$FILE_SEARCHED"/*; do
[[ -e "$file_in_dir" ]] || break # handle the case of no file in dir
[[ -e "$file_in_dir" ]] || break # handle the case of no file in dir
does_pattern_exist_in_file "$file_in_dir" "^$PATTERN"
if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $file_in_dir"
@ -63,7 +63,7 @@ apply() {
if test -d "$FILE_SEARCHED"; then
debug "$FILE_SEARCHED is a directory"
for file_in_dir in "$FILE_SEARCHED"/*; do
[[ -e "$file_in_dir" ]] || break # handle the case of no file in dir
[[ -e "$file_in_dir" ]] || break # handle the case of no file in dir
does_pattern_exist_in_file "$file_in_dir" "^$PATTERN"
if [ "$FNRET" != 0 ]; then
debug "$PATTERN is not present in $file_in_dir"