Re: NCL as a scripting language: one step further

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 13 May 2009 22:20:41 -0600 (MDT)

Hi Rob,

You bring up an interesting question. I'm afraid the answer is
"no", there's no way to get the first (or any) line to be ignored,
unless it has a ";" in front.

And, technically, fatal errors are supposed to cause NCL to
exit, but our error handling is not consistent in this manner.
(Something we're planning to remedy.)

I can see the value of your request, and I'll put it on the list.

--Mary

On Wed, 13 May 2009, Rob Nicholas wrote:

> Hi all,
>
> I know that many folks use NCL within Csh or Bash script using
> something like the following approach:
>
> #!/bin/sh
> cat > temp_ncl_script.ncl << EOF
> begin
> .
> .
> .
> end
> EOF
> ncl temp_ncl_script.ncl
> rm temp_ncl_script.ncl
>
> However, it turns out that the following *simpler* approach will also work...
>
> #!/usr/local/bin/ncl
> begin
> .
> .
> .
> end
>
> ...but with one minor problem: NCL generates an error on the first
> line of the script. Does anyone know of a way to get NCL to ignore
> the opening line of the above script when it is executed directly from
> the shell?
>
> While I'm on the subject, I'd like to make a request to the
> developers: Although both # and ! have particular meanings within
> NCL, would it be possible to have NCL ignore the first line of a
> script if it begins with a "#!"? If not added as a standard behavior,
> could it be enabled with a command line option?
>
> Thanks,
> Rob
> _______________________________________________
> 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
Received on Wed May 13 2009 - 22:20:41 MDT

This archive was generated by hypermail 2.2.0 : Tue May 19 2009 - 09:17:29 MDT