#!/bin/sh
echo "====================="
for file in $(echo `ls *.nc `) ; do
	echo "file: ${file}"
	# sed ok for filename in style: q_10.1989_orca2.nc
	# sed ok for filename in style: filename.date_orca2.nc
	newfile=`ls $file | sed -e "s@\.\([0-9]*\).*\(_[^\.]*\)@\2_\1@"`
	echo "new file: $newfile"
	`mv $file $newfile`
done
echo "@@@@@@@@@@@@@@@@@@@@@@@@"
