New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
change_names.date.sh on IS-ENES/core2_cmip – Attachment – NEMO

IS-ENES/core2_cmip: change_names.date.sh

File change_names.date.sh, 356 bytes (added by flavoni, 14 years ago)
Line 
1#!/bin/sh
2echo "====================="
3for file in $(echo `ls *.nc `) ; do
4   echo "file: ${file}"
5   # sed ok for filename in style: q_10.1989_orca2.nc
6   # sed ok for filename in style: filename.date_orca2.nc
7   newfile=`ls $file | sed -e "s@\.\([0-9]*\).*\(_[^\.]*\)@\2_\1@"`
8   echo "new file: $newfile"
9   `mv $file $newfile`
10done
11echo "@@@@@@@@@@@@@@@@@@@@@@@@"