On branch parse-mdls
Your branch is up to date with 'origin/parse-mdls'. Changes to be committed: modified: hash-files Drafting CSV format
This commit is contained in:
parent
d6bc8b84b3
commit
5b81d72b2b
29
hash-files
29
hash-files
@ -40,10 +40,10 @@ mdls_files () {
|
|||||||
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
|
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
|
||||||
if [[ " ${keys_of_interest[*]} " =~ " ${mdls_key} " ]];then
|
if [[ " ${keys_of_interest[*]} " =~ " ${mdls_key} " ]];then
|
||||||
IFS=$old_IFS
|
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
|
unset IFS
|
||||||
else
|
else
|
||||||
echo "Did not print!"
|
: #echo "Did not print!"
|
||||||
fi
|
fi
|
||||||
IFS=$old_IFS
|
IFS=$old_IFS
|
||||||
done
|
done
|
||||||
@ -63,11 +63,16 @@ hash_files () {
|
|||||||
create_csv () {
|
create_csv () {
|
||||||
#echo "=== Create array of comma-separated-values. ===
|
#echo "=== Create array of comma-separated-values. ===
|
||||||
#=================================================="
|
#=================================================="
|
||||||
for i in ${!list_of_files[@]}; do
|
csv_columns=( "File Path" "File Hash" )
|
||||||
csv_array+=( ${list_of_files[i]},${list_of_hashes[i]} )
|
for key in ${keys_of_interest[@]};do
|
||||||
|
csv_columns+=( ${keys_of_interest[key]} )
|
||||||
done
|
done
|
||||||
export csv_array
|
echo ${csv_columns[@]}
|
||||||
write_log "CSV Array creation successful."
|
# 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 () {
|
write_data () {
|
||||||
@ -94,12 +99,12 @@ trap cleanup EXIT
|
|||||||
echo "Main Start"
|
echo "Main Start"
|
||||||
create_list_of_files
|
create_list_of_files
|
||||||
mdls_files
|
mdls_files
|
||||||
#hash_files
|
hash_files
|
||||||
#if [ ${#list_of_files[@]} != ${#list_of_hashes[@]} ];then
|
if [ ${#list_of_files[@]} != ${#list_of_hashes[@]} ];then
|
||||||
# echo "Error! Number of files and hashes differs. Exiting..." && exit
|
echo "Error! Number of files and hashes differs. Exiting..." && exit
|
||||||
#else
|
else
|
||||||
# create_csv
|
create_csv
|
||||||
#fi
|
fi
|
||||||
#write_data
|
#write_data
|
||||||
|
|
||||||
#while $list_of_files >=1; do
|
#while $list_of_files >=1; do
|
||||||
|
Loading…
Reference in New Issue
Block a user