/[MITgcm]/MITgcm_contrib/jmc_script/rnp
ViewVC logotype

Annotation of /MITgcm_contrib/jmc_script/rnp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Oct 12 14:46:35 2003 UTC (20 years, 6 months ago) by jmc
Branch: MAIN
Some basic scripts are gather here:
a) the restart test : "1+1=2"
b) PBS batch script that resubmit itself (loop).

1 jmc 1.1 #! /bin/sh
2     case $# in
3     2|3) ;;
4     *) echo "Usage: `basename $0` [Dir] old_prefx new_prefx [prefx_selecteur]"
5     exit ;;
6     esac
7     cmd='ls' ; opt='-f'
8     if test $1 = 'Dir' ; then cmd='ls -d' ; opt='-d' ; shift ; fi
9     rac=$1
10     new=$2
11     if test $rac = '=' ; then rac='' ; fi
12     if test $new = '=' ; then new='' ; fi
13     if test $# = "3" ; then sel=$3 ; else sel=$rac ; fi
14     #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
15     liste=`$cmd ${sel}*`
16     #echo $liste ; exit
17     for xx in $liste
18     do
19     sufx=`echo $xx | sed "s/^$sel//g"`
20     #echo $sufx
21     if test $opt $rac$sufx
22     then echo mv $rac$sufx $new$sufx ; mv -i $rac$sufx $new$sufx
23     else echo pas de fichier $rac$sufx
24     fi
25     done
26     exit

  ViewVC Help
Powered by ViewVC 1.1.22