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

Contents of /MITgcm_contrib/jmc_script/rnp

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


Revision 1.2 - (show annotations) (download)
Thu Mar 31 14:48:15 2005 UTC (15 years ago) by jmc
Branch: MAIN
CVS Tags: testing_tag01, HEAD
Changes since 1.1: +10 -4 lines
minor changes

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

  ViewVC Help
Powered by ViewVC 1.1.22