On Thu, 21 Jun 2007 23:17:29 +0200
"Mirco Piccin" <[EMAIL PROTECTED]> 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.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to