I need help running a script. I have the script looking into a folder and converting .doc files to .odt. The script works fine except that I want it to only run when .doc files are present. If I can do this then I can put .xls files and .ppt files in the folder and convert them when they are detected.
This is what I currently have:
Code:
#! /bin/bash
for file in *.doc
do
if [ -e "*.doc" ]
then
mkdir ./ODT
python /opt/DocumentConverter/DocumentConverter.py "${file}" "${file}".odt
for i in *.odt; do j=`echo $i | sed 's/doc.odt/odt/g'`; mv "$i" ./ODT/"$j"; done
fi
done