I am trying to know the length of a variable 'i' in a netcdf file '122009.nc'. This is my script so far:
#!bin/bash
var=ncdump -v i 122009.nc
var_length=${#var}
I am trying to know the length of a variable 'i' in a netcdf file '122009.nc'. This is my script so far:
#!bin/bash
var=ncdump -v i 122009.nc
var_length=${#var}
The line :
var=ncdump -v i 122009.nc
needs to be:
var=$(ncdump -v i 122009.nc)
This will allow the result of the command to be read into var and later used to find the length