When I run the following command in a directory of an extracted (inflated) XLSX, I get the all URLs found within the sub-folder files.
find . -exec exiftool {} \; | grep http
Now I want to run this as part of a bash script I have developed but it simply doesn't show anything upon completion.
Here is the code in the script:
if [[ $fileName == *.xlsx ]]; then
#file is XML based, create new directory with file name, copy file there and extract
echo "Creating directory\n"
DATE=`date +%Y-%m-%d`
mkdir "Files/$DATE-$fileName-$USER"
cp $filePath "Files/$DATE-$fileName-$USER"
unzip "Files/$DATE-$fileName-$USER/$fileName" -d "Files/$DATE-$fileName-$USER/"
result="find 'Files/$DATE-$fileName-$USER/$fileName' -exec exiftool {} \; | grep http"
printf $result
fi
Your support is appreciated in figuring out what's wrong here.
== *.xlsx... is this a real construct? wouldn't be better served by something likeif echo $filename | grep -E '*[.]xlsx$' ; then*is supposed to represent "zero or more of the preceding atom".