[bash] make array in vim

ref, ref2, ref3

This method is used when I treat the Japanese reanalysis data (JRA55). Because it has unmatched variable names with file names (e.g. rh for file name and RHprs for variable name).

 

Actually making array is very simple. you just need to use ().

 

Example for the variables such as RH, TMP, UGRD, VGRD,

varid=(‘RH’ ‘TMP’ ‘UGRD’ ‘VGRD’)  # varid is the group name.

 

Real Eample with printing expression,

varid=(‘RH’ ‘TMP’ ‘UGRD’ ‘VGRD’)  # varid is the group name.

for var in rh tmp ugrd vgrd;do

echo $var, ${varid[$kk]}prs

done

 

That’s it!

So, Simple 🙂

Advertisements