On Fri, 31 May 2002, C Falconer wrote:

> pants:/public_html/jubilee# cat index.html | jpegtopnm
> Not a JPEG file: starts with 0x3c 0x21
>
> pants:/public_html/jubilee# cat cover.jpg  | jpegtopnm > /dev/null
> jpegtopnm: WRITING PPM FILE

It might be better to use the return code. Try something like this in
bash:

if (jpegtopnm < "${FILE}" 2>&1 > /dev/null) ; then
        echo jepg file
else
        echo not a jpeg file
fi

tim
http://www.cosc.canterbury.ac.nz/~tnw13

Quidquid latine dictum sit, altum viditur.

Reply via email to