On branch parse-mdls
Your branch is up to date with 'origin/parse-mdls'. Changes to be committed: modified: hash-files Added effective test for mdls_key in keys_of_interest.
This commit is contained in:
parent
2729af8349
commit
d6bc8b84b3
@ -34,13 +34,18 @@ create_list_of_files () {
|
|||||||
mdls_files () {
|
mdls_files () {
|
||||||
for file in $list_of_files; do
|
for file in $list_of_files; do
|
||||||
for line in $(mdls $file); do
|
for line in $(mdls $file); do
|
||||||
|
old_IFS=$IFS
|
||||||
|
unset IFS
|
||||||
mdls_key=$(printf "%s" $line | cut -d '=' -f 1)
|
mdls_key=$(printf "%s" $line | cut -d '=' -f 1)
|
||||||
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
|
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
|
||||||
if $(echo $keys_of_interest | grep $mdls_key);then
|
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
|
else
|
||||||
echo "Did not print!"
|
echo "Did not print!"
|
||||||
fi
|
fi
|
||||||
|
IFS=$old_IFS
|
||||||
done
|
done
|
||||||
|
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user