I have the variable:
files=$(ls *.nc)
Which contain hourly netcdf files that I want to merge into daily files using cdo.
I need to create something like "cdo merge $files[1] $files[2] .... $files[24] all.nc"
and run the expression. How can I create this expression in shell?