|
|
|
@ -40,10 +40,10 @@ mdls_files () { |
|
|
|
|
mdls_value=$(printf "%s" $line | cut -d '=' -f 2) |
|
|
|
|
if [[ " ${keys_of_interest[*]} " =~ " ${mdls_key} " ]];then |
|
|
|
|
IFS=$old_IFS |
|
|
|
|
printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value |
|
|
|
|
: #printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value |
|
|
|
|
unset IFS |
|
|
|
|
else |
|
|
|
|
echo "Did not print!" |
|
|
|
|
: #echo "Did not print!" |
|
|
|
|
fi |
|
|
|
|
IFS=$old_IFS |
|
|
|
|
done |
|
|
|
@ -63,11 +63,16 @@ hash_files () { |
|
|
|
|
create_csv () { |
|
|
|
|
#echo "=== Create array of comma-separated-values. === |
|
|
|
|
#==================================================" |
|
|
|
|
for i in ${!list_of_files[@]}; do |
|
|
|
|
csv_array+=( ${list_of_files[i]},${list_of_hashes[i]} ) |
|
|
|
|
csv_columns=( "File Path" "File Hash" ) |
|
|
|
|
for key in ${keys_of_interest[@]};do |
|
|
|
|
csv_columns+=( ${keys_of_interest[key]} ) |
|
|
|
|
done |
|
|
|
|
export csv_array |
|
|
|
|
write_log "CSV Array creation successful." |
|
|
|
|
echo ${csv_columns[@]} |
|
|
|
|
# for i in ${!list_of_files[@]}; do |
|
|
|
|
# csv_array+=( ${list_of_files[i]},${list_of_hashes[i]} ) |
|
|
|
|
# done |
|
|
|
|
# export csv_array |
|
|
|
|
# write_log "CSV Array creation successful." |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
write_data () { |
|
|
|
@ -94,12 +99,12 @@ trap cleanup EXIT |
|
|
|
|
echo "Main Start" |
|
|
|
|
create_list_of_files |
|
|
|
|
mdls_files |
|
|
|
|
#hash_files |
|
|
|
|
#if [ ${#list_of_files[@]} != ${#list_of_hashes[@]} ];then |
|
|
|
|
# echo "Error! Number of files and hashes differs. Exiting..." && exit |
|
|
|
|
#else |
|
|
|
|
# create_csv |
|
|
|
|
#fi |
|
|
|
|
hash_files |
|
|
|
|
if [ ${#list_of_files[@]} != ${#list_of_hashes[@]} ];then |
|
|
|
|
echo "Error! Number of files and hashes differs. Exiting..." && exit |
|
|
|
|
else |
|
|
|
|
create_csv |
|
|
|
|
fi |
|
|
|
|
#write_data |
|
|
|
|
|
|
|
|
|
#while $list_of_files >=1; do |
|
|
|
|