Hello Erik,
You are not exporting the SHELL variable to the ENVIRONMENT.
Try:
;--------------------
for fil in $FILI
do
export file_seen_in_ncl=$fil
ncl test.ncl
done
;--------------------
test.ncl:
file_in = getenv("file_seen_in_ncl")
print(file_in)
;--------------------
If you want all the files in one process, you can also try (assuming $FILI has been exported):
in_files = str_split(getenv("FILI"), " ")
Regards,
Griff.
Message: 1
Date: Tue, 1 Nov 2011 12:45:33 -0400
From: Erik N <nobleeu@gmail.com>
Subject: puzzled with using getenv for getting shell
environment variable
To: ncl-talk@ucar.edu
Message-ID:
<CAHs0rMq=r3dFrbxJjfO14Wxq73qYSyjCaUNXSZuNCKUmK1rT0w@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
I'm having difficulty with passing a shell environment variable to the ncl script with the getenv command.
The environment variable is "fil."
The shell script works fine.
But when I look at the ncl output using the print statement, the string is missing. It is supposed to say "ncep2_grid_Experiment_.... "
Is this expected?
-Erik
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 1 18:10:56 2011
This archive was generated by hypermail 2.1.8 : Fri Nov 04 2011 - 08:43:41 MDT