Hi Jerome,
You don't need the outer grave-accents on the "let isfile" command.
This should work - define the _expression_ in one command, evaluate it
in the next.
repeat/range=1998:2010/name=yr ( \
let fname = "`URLname`/dataset_`yr`.nc"; \
let isfile = test_opendap("`fname`"); \
if `isfile eq 0` then; ...)
On 7/26/2017 2:42 PM, Jerome Fiechter
wrote:
Hi,
I am trying to use "test_opendap" within a loop
that generate a URL name, but I end up getting
an "unclosed quotation error" because of nested
`. My script looks like:
repeat/range=1998:2010/name=yr ( \
let fname = "`URLname`/dataset_`yr`.nc"; \
let isfile = `test_opendap("`fname`")`; \
if `isfile eq 0` then; ...)
The command `test_opendap("`fname`")` is what's causing
the problem, but I cannot figure out how to pass a
variable file name to the test_opendap function without
using a nested `.
Any help would be much appreciated.
Thanks,
Jerome
|