Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ScriptName=$(basename $0)
- DelBackup="false"
- Notify="false"
- HelpText="Deletes the extra file created by latex and it's variants in the
- current working directory.
- Usage: $ScriptName [options]
- Options:
- -h|--help Show this help and exit
- -b Delete backup (*.*~ and .*.swp) files. Default.
- -b- Don't delete backup (*.*~ and .*.swp) files
- -n Notify after delete completion.
- -n- Don't notify after delete completion.
- "
- ErrMsg="$ScriptName: Unspecified option. Aborting."
- while test -n "$1"
- do
- case "$1" in
- -h|--help) echo -n "$HelpText"
- exit 0
- ;;
- -b) DelBackup="true" ;;
- -b-) DelBackup="false" ;;
- -n) Notify="true" ;;
- -n-) Notify="false" ;;
- *) echo "$ErrMsg"
- exit 1 ;;
- esac
- shift
- done
- rm -fv *.aux *.log *.dvi *.blg *.bbl *.bbx *.end *.out *.toc *.los *.bak \
- *.hp *.relyx* *.over *.nav *.snm *.vrb *.tmp *.idx *.ilg *.ind \
- *.lof *.lot core *.gls *.nlo *.nls *.inputs *.bm *.fdb_latexmk \
- *.synctex.gz *.pdfsync
- if [ "$DelBackup" == "true" ];then
- rm -fv .*.swp *.*~ *.*.backup
- fi
- ## Requires libnotify-bin to be installed
- if [ "$Notify" == "true" ];then
- notify-send -t 3000 "Deljunk" "Deleting junk files complete" &
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement