Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # usage convert_to_pdf.sh [directory] [delete after conversion(y/n)] [run recursivly (y/n)]
- OLDIFS="$IFS"
- IFS=""
- cd $1
- lowriter --convert-to pdf *.doc
- lowriter --convert-to pdf *.docx
- lowriter --convert-to pdf *.rtf
- if [ "$2" = "y" ]; then
- rm *.doc
- rm *.docx
- rm *.rtf
- fi
- if [ "$3" = "y" ]; then
- find $1 -type d -exec bash -c "cd '{}' && /home/main/Scripts/convert_to_pdf.sh '{}' $2 n" \;
- fi
- IFS=$OLDIFS
Advertisement
Add Comment
Please, Sign In to add comment