[ncl-talk] ncl systemfunc

Matthias Demuzere Matthias.Demuzere at UGent.be
Fri Feb 10 12:54:06 MST 2017


Hi Rick,

Yes... I tested this for a single string without curly brackets (eg. *.nc) and that works fine ...
Does this indicate there is somehow a system dependency, even though the curly brackets do work directly in the terminal? Quite puzzling, no?

Matthias

On 10 Feb 2017 18:30, Rick Brownrigg <brownrig at ucar.edu> wrote:
Hi Matthias,

That is very odd -- it works for me, both at bash command line and using systemfunc() from within NCL.  Can you get systemfunc to return files from a directory without using "{}" notation, .i.e, "ls *" for example? Or simply "ls foo" where the file foo is known to exist in the current directory?

Rick

On Fri, Feb 10, 2017 at 10:15 AM, Matthias Demuzere <matthias.demuzere at ugent.be<mailto:matthias.demuzere at ugent.be>> wrote:
Dear all,

I am currently testing the CVDP (http://www.cesm.ucar.edu/working_groups/CVC/cvdp/) which is written in ncl.
Currently the software does not run because it can't find the proper datasets.

Finding the data is driven by the systemfunc command using curly brackets (multiple options).
For example, within ncl, I want to list all files that have one of the following extension: .nc, .hdf, .pdf.

This I do with:
myFiles = systemfunc("ls /DIRECTORY/*{.nc,.hdf,.pdf}")

If I fo this in ncl, I get an error: ls: cannot access '/DIRECTORY/*{.nc,.hdf,.pdf}': No such file or directory

Yet, when pasting ls /DIRECTORY/*{.nc,.hdf,.pdf} directly in my system (ubuntu 16.04, 64bit) terminal, I do get a list of the finals with this extension. So the expected result.

I have tested this in ncl-6.3.0 and 6.2.1, but I have the same problem in both.
Did anyone else notice this before? Any idea on how to fix this?

Thanks!

Regards,
Matthias



--
Post-doctoral Research Fellow
_____________________________

UGent [Home]
Department of Forest and Water Management
Laboratory for Hydrology and Water Management
Coupure links 653, B-9000 Ghent, Belgium
Email: Matthias.demuzere at UGent.be<mailto:Matthias.demuzere at UGent.be>
Web: http://www.ugent.be/bw/dfwm/en/research/LHWM/staff/matthias

KU Leuven [Affiliated]
Department of Earth & Environmental Sciences
Division of Geography and Tourism / Regional climate studies
Celestijnenlaan 200E, B-3001 Heverlee (Leuven), Belgium
Email: matthias.demuzere at kuleuven.be<mailto:matthias.demuzere at kuleuven.be>
Web: https://ees.kuleuven.be/geography/rcs

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170210/adc7a134/attachment.html 


More information about the ncl-talk mailing list