[Thread Prev][Thread Next][Index]

[ferret_users] How to pass the value from a ferret script to a c shell file ?



Hi,
I am not sure which email is correct one for ferret. If I send the question twice, sorry about it. I usually embedded a ferret script in my c shell files when I need to use ferret. However, I do not know how to save the value of a variable in ferret script and pass that value to another variable in my c shell file. For example, I have a c shell file called aFile.csh and in it, it has something as

"#!bin/csh -f
.....
....
#embedded ferret script
ferret << STOP

use data.nc
let variableInFerret = x + y

exit
STOP
......
#starting c shell commands
set varInCshell = $variableInFerret

if( $varInCshell > 100 ) then
echo "it is 100"
endif
...
"
I calculated the value for variable, variableInFerret in ferret script and use it in my c shell file such as assigning it to another variable and testing it.Now, I can only think of saving the value in a file by using LIST command in ferret and then read value from it in c shell. However, it seems very inefficient. I wonder if there is any other way to achieve the same
goal.Thank you very much,



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement