Re: Running NCL script from linux command line

From: <brownrig_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 18 2013 - 15:47:55 MDT

Hi Naoki,

My understanding (and I could be wrong) is that the "#!....." idiom is
a shell convention that happens to work for other interpreters such as
tclsh and perl because they use "#" as a comment character. It sounds
like the shell is correctly invoking NCL and passing to it your
script; NCL sees the 1st line and does not recognize the "#"
character as a comment indicator. Curiously, if your script does
indeed execute, the error message is a bit deceptive as its not so
fatal as it indicates.

So the short of it is I don't think you can do what you are
attempting, or at least not without seeing an error message every time
you run your scripts.

Rick

On Wed, 18 Sep 2013 14:15:50 -0600
  Naoki Mizukami <mizukami@ucar.edu> wrote:
> Hi,
>
> I try to run ncl script with #!/opt/ncl/bin/ncl or #!/usr/bin/env
>ncl at
> top of script
>
> so just I type ./<scripit_name> rather than ncl <script_name>.
>
> I got error message
> +++++++++++++++++++++++++++++++++++++++++++++++
> fatal:syntax error: line 1 in file ./Create_geo_grid_conus.ncl
>before or
> near #
> #
> ^
>
> fatal:error in statement
> ++++++++++++++++++++++++++++++++++++++++++++++++
>
> but seems like the scripts runs actually.
>
> Wondering if I am supposed to be able to do?
>
>
> Thanks,
> Naoki
>
> --
> Naoki Mizukami
> National Center for Atmospheric Research
> 3450 Mitchell Lane
> Boulder, CO 80301
>
> office FL2 3094H
> phone 303-497-2739
>
> _______________________________________________
> 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 Sep 18 15:48:15 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 01 2013 - 14:41:43 MDT