diff --git a/dotfiles/scripts.org b/dotfiles/scripts.org index 246cac3..3a94699 100644 --- a/dotfiles/scripts.org +++ b/dotfiles/scripts.org @@ -111,9 +111,9 @@ The requirement is to have =pdftk= or =stapler= installed. #+begin_src bash if [[ -f $1 && $1 == *.pdf ]]; then # Argument if a file - if type stapler > /dev/null; then + if type stapler > /dev/null 2>&1; then stapler del "$1" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1" - elif type pdftk > /dev/null; then + elif type pdftk > /dev/null 2>&1; then pdftk "$1" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1" else echo "Neither pdftk nor stapler are installed"