command line variable string

From: David Hebert <david.hebert_at_nyahnyahspammersnyahnyah>
Date: Fri Feb 03 2012 - 06:19:36 MST

I have a bunch of daily output netcdf files I would like to make plots
of. For short

700_cice.2011-12-29.nc
700_cice.2011-12-30.nc
700_cice.2011-12-31.nc

My original intent was to pass the file name as a command line variable,
then parse for dtg. When I do the following:

foreach i (*.nc)
     echo $i
     ncl plot_aice.ncl fname=$i
end

I get an error:

  700_cice.2011-12-29.nc (from echo $i)

  Copyright (C) 1995-2011 - All Rights Reserved
  University Corporation for Atmospheric Research
  NCAR Command Language Version 6.0.0
  The use of this software is governed by a License Agreement.
  See http://www.ncl.ucar.edu/ for more details.
fatal:syntax error: line 1 in file /tmp/ncl951.ncl before or near _cice
fname=700_cice
-------------^
fatal:(missing) has no file extension, can't determine type of file to open
fatal:Either file (f) isn't defined or variable (aice) is not a variable
in the file
fatal:Execute: Error occurred at or near line 30 in file plot_aice.ncl

I don't think that underscore or dot are special characters that require
backslash. Is there a better way to pass the file name on the command
line? I see on the NCL website that one can use single quotes, but that
will prevent the shell from expanding the variable $i.

Thanks for any suggestions!
David

-- 
David A. Hebert
Naval Research Lab
Stennis Space Center, MS 39529
david.hebert@nrlssc.navy.mil <mailto:david.hebert@nrlssc.navy.mil>
Phone: (228) 688-5846
Fax: (228) 688-4759

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 3 06:19:50 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST