Re: Running several *.ncl files from command line

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 19 2012 - 14:50:22 MDT

You can also use a foreach command right at the UNIX prompt:

foreach f(*.ncl)
echo "Executing example $f"
ncl $f
end

You can put the above in a shell script too.

--Mary

On Mar 19, 2012, at 2:08 PM, Dennis Shea wrote:

> You could use a schell script or perl or python or ...
>
> The folling could be an NCL script, say, run_ncl
>
> scrDir = "./"
> scrNames = (/"foo_1.ncl", "dumy_2.ncl", "tst_3.ncl"/)
>
> nscr = dimsizes(scrNames)
>
> do ns=0,nscr-1
> system("ncl "+scrDir+scrNames(ns))
> end do
>
>
> %> ncl run_ncl
>
> the scrNames could be specified manually (as above) or via
>
>
> scrNames = systemfunc("cd "+scrDir+" ; ls *ncl")
>
> Good luck
>
> On 3/19/12 11:42 AM, Panday, Prajjwal wrote:
>> Hello
>>
>> I have a list of files ending in *.ncl. Is there a way I can list them
>> all in a text file and run them from the command line rather than having
>> to execute one by one?
>>
>> Thanks,
>> Prajjwal
>>
>>
>> _______________________________________________
>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 19 14:50:32 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 20 2012 - 15:27:15 MDT