cd62131

ncdump all

Jul 24th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/bin/bash -eu
  2. NCDUMP='/export/emc3/RHEL6/util/gnu/netcdf-4.4.1.1/bin/ncdump'
  3. NC='/home/201612%02d_%02d.nc'
  4. AB='ab%02d_%02d.txt'
  5.  
  6. [[ ! -x ${NCDUMP} ]] && exit 1
  7. for day in $(seq 1 31); do
  8.   for hour in $(seq 0 23); do
  9.     nc=$(printf "${NC}" ${day} ${hour})
  10.     ab=$(printf "${AB}" ${day} ${hour})
  11.     ${NCDUMP} -v lon ${nc} &>${ab}
  12.     sed -i '1,283d' ${ab}
  13.   done
  14. done
  15. cat ab??_??.txt >AB.txt
Add Comment
Please, Sign In to add comment