diff options
author | mslifcak <slifcan@gmail.com> | 2018-01-17 15:49:07 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2018-01-17 15:49:07 +0300 |
commit | 2c774b8795b88616ac36466370bb6fb54d7d924e (patch) | |
tree | ab51f8e7c016dab36d09f060cec2fdbf7549f630 /include/binaries | |
parent | f79cb08db36db7c827f2b4bdb0d021b7096d57bb (diff) |
sort BIN_PATHS before process (#510)
Diffstat (limited to 'include/binaries')
-rw-r--r-- | include/binaries | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/binaries b/include/binaries index ee2818e5..1f31ee99 100644 --- a/include/binaries +++ b/include/binaries @@ -44,8 +44,8 @@ # Test if our PATH variable provides a set of paths (otherwise we use predefined list in include/consts) if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo ${PATH} | tr ':' ' '); fi - - for SCANDIR in ${BIN_PATHS}; do + SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ') + for SCANDIR in ${SORTED_BIN_PATHS}; do LogText "Test: Checking binaries in directory ${SCANDIR}" ORGPATH="" if [ -d ${SCANDIR} ]; then @@ -277,6 +277,7 @@ LogText "Result: Directory ${SCANDIR} does NOT exist" fi done + unset SORTED_BIN_PATHS BINARY_SCAN_FINISHED=1 BINARY_PATHS_FOUND=$(echo ${BINARY_PATHS_FOUND} | sed 's/^, //g' | sed 's/ //g') LogText "Discovered directories: ${BINARY_PATHS_FOUND}" |