[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cups-pdf



On Thu, 21 Jun 2007 23:17:29 +0200
"Mirco Piccin" <pictux@gmail.com> wrote:

> if [ `echo $2 | grep -ce "\.[Pp][Dd][Ff]"` -le 0 ]
>   then
>     echo `date` " - ERR: This scripts accepts only PDF format as
> input file!!! ($2)" >> $LOGFILE 2>&1
>     exit 1
> fi

This is IMO too Windows-like -- just relying on a filename to guess content. I'd do it like this:

if [ "$(file -bi $2)" = "application/pdf" ] ...

--D.



Reply to: