Automator service: delete last page from PDF with use of pdfsplit via bash
You have a couple of errors on your syntax. Replace the following lines:

pages=`pdfcount "$f"`
pagescut=`$(( ${pages} - 1 ))`


With this ones:

pages=$(pdfcount "$f")
pagescut=$(($pages - 1))