[ncl-talk] Question about using curl instead of wget in system call

Mary Haley haley at ucar.edu
Fri Aug 24 08:15:48 MDT 2018


Hi Barry,

For future reference, you can check out our system interaction examples
page, which has some scripts of doing this kind of thing:

http://www.ncl.ucar.edu/Applications/system.shtml

--Mary


On Wed, Aug 22, 2018 at 10:49 AM, Dennis Shea <shea at ucar.edu> wrote:

> Use:
>
> *http://www.ncl.ucar.edu/Document/Functions/Built-in/str_get_dq.shtml*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/str_get_dq.shtml>
> =========================================================================
> dq = *str_get_dq*()
>
> HTTP = "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?
> file=gfs.t00z.pgrb2.0p25.f240&all_lev=on&all_var=on&subregion=&leftlon=15&
> rightlon=50&toplat=50&bottomlat=15&dir=%2Fgfs.2018082200"
>
> CURL = "curl -s "+ dq+HTTP+dq +" -o junk"
> *print*(CURL)
>
> *system*(CURL)
>
> ==========================================================================
> See also:
>
> *http://www.ncl.ucar.edu/Document/Functions/Contributed/cla_sq.shtml*
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/cla_sq.shtml>
>
> On Wed, Aug 22, 2018 at 1:49 AM, Barry Lynn <barry.h.lynn at gmail.com>
> wrote:
>
>> Hi:
>>
>> I can use wget in a system's call to download data. Thank you for taking
>> a look.
>>
>> system ("wget http://ftp.ncep.noaa.gov/data/nccf/com/gfs/prod/gfs.201808
>> 2200/gfs.t00z.pgrb2.0p25.f240")
>>
>>
>> However, if I want to use curl, I am not sure where and how to place the
>> quotation marks.
>>
>>
>> This works outside of ncl.
>>
>>
>> curl -s "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file
>> =gfs.t00z.pgrb2.0p25.f240&all_lev=on&all_var=on&subregion=&
>> leftlon=15&rightlon=50&toplat=50&bottomlat=15&dir=%2Fgfs.2018082200"  -o
>> junk
>>
>>
>> This does not:
>>
>>
>> system ( "curl -s http://nomads.ncep.noaa.gov/cg
>> i-bin/filter_gfs_0p25.pl?file=gfs.t00z.pgrb2.0p25.f240&all_
>> lev=on&all_var=on&subregion=&leftlon=15&rightlon=50&toplat=
>> 50&bottomlat=15&dir=%2Fgfs.2018082200 -o junk")
>>
>>
>>
>>
>> --
>> Barry H. Lynn, Ph.D
>> Senior Associate Scientist, Lecturer,
>> The Institute of the Earth Science,
>> The Hebrew University of Jerusalem,
>> Givat Ram, Jerusalem 91904, Israel
>> Tel: 972 547 231 170
>> Fax: (972)-25662581
>>
>> C.E.O, Weather It Is, LTD
>> Weather and Climate Focus
>> http://weather-it-is.com
>> Jerusalem, Israel
>> Local: 02 930 9525
>> Cell: 054 7 231 170
>> Int-IS: x972 2 930 9525
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180824/ae77f722/attachment.html>


More information about the ncl-talk mailing list