I am new in UNIX and I want to apply the CDO (Climate Data Operator) "remapbil" command in order to transform the grid (from a projection to geographical coordinate system). it works perfectly fine for 1 single file with the following command:
cdo remapbil,target.grd hurs_EUR-11_ICHEC-EC-EARTH_rcp26_r3i1p1_DMI-HIRHAM5_v1_day_20360101-20401231.nc hurs_36_40_bil.nc
But I have to do it for a lot of different files. For this reason, I have tried to write the following bash shell that will allow me to run the remapbil command for all file i have in my directory:
#!/bin/bash
for i in *.nc;
do
echo $i
for file in "ls *.nc"; do
cdo remapbil,target.grd tas_EUR-11_ICHEC-EC-EARTH_rcp45_r3i1p1_DMI-HIRHAM5_v1_day_20210101-20251231.nc > tas_$i_bil.nc
done
done
But i always get the following Error:
cdo remapbil (Abort): Too few streams specified! Operator needs 1 input and 1 output streams.
Can probably someone help me, that would be great