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

Re: How to make curl print only html content?



On Wed, Feb 29, 2012 at 05:30:43PM +0800, 斟酌鵬兄 wrote:
>Date: Wed, 29 Feb 2012 17:30:43 +0800
>From: 斟酌鵬兄 <tgckpg@gmail.com>
>To: debian-user@lists.debian.org
>Subject: How to make curl print only html content?
>
>I wanna make curl in a cronjob like this
>FILE=$(curl http://www.examples.com)
>
>But when I did this cron sent me an email with curl's output :
>
>% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
>
>0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 13 0 13 0 0 18 0 --:--:-- --:--:-- --:--:-- 60
>
>How do I make it silent?
>
>with -silent option I get its headers assigned in $FILE too
>How do I get rid of it?
>
>
>Regards,
>Penguin

The curl's output above is stderr.  You can execute like this:
    =$(curl http://www.examples.com 2>/dev/null)


Reply to: