Re: about passing parameter

From: David B. Reusch <dreusch_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 14 2014 - 09:16:06 MDT

I think you just need additional single quotes (') on the call to ncl.
The first goes before the "$" and the second goes after the "}". At
least this is what I would do in csh and I'm assuming it's the same in
bash. The way it is now, the shell is not substituting the season variable.

Hope this helps,
Dave

wen said the following on 3/14/2014 7:53 AM:
> Hi Dennis,
> Thanks for you help. I write linux-shell-script to pass parameter of
> type of string. It do not work. Do you know why? Following is the
> linux-shell-script.
>
> #!/bin/bash
> season=(JJA DJF MAM)
> for ((k=0; k<${#season[@]}; k=k+1))
> do
> ncl 'se="${season[${k}]}"' test.ncl
> done
>
>
>
>
> --
> ??
> ???
>
> At 2014-03-14 21:23:55,"Dennis Shea" <shea@ucar.edu> wrote:
> >Please read:
> > http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclCLO.shtml
> >
> >There are many examples.
> >
> >
> >%>ncl 'fil="sample.nc"' ys=1979 ye=2005 ex=0 lgen=1 minpre=0.1 lgex=2
> >maxpre=3 day_int_amo_annual.ncl
> >
> >On 3/14/14, 6:54 AM, wen wrote:
> >> Hi all, I run a ncl script by passing parameter as following. I found it work well when the type of parameter is numerical type. However, it did not work when the type of parameter is string. Could ncl pass parameter of type of string? If anyone know that , please tell me. Thank you!
> >> ncl ys=1979 ye=2005 ex=0 lgen=1 minpre=0.1 lgex=2 maxpre=3 day_int_amo_annual.ncl
> >>
> >>
> >>
> >>
> >>
> >> --
> >>
> >> Best wishes
> >> Guanhuan Wen
> >>
> >>
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Associate Research Professor of Climatology
Dept of Earth and Environmental Science
MSEC 304; 801 Leroy Pl
New Mexico Tech
Socorro, NM 87801

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 14 09:16:23 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT