X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=scripts%2FrenameSalomeModule;h=63c90b7c0af6ca68c7372631ee7fe7f297abd004;hb=refs%2Ftags%2FV5_1_2rc2;hp=7354291e8b1b9f0e8b2dc1f8b32dff4054873b48;hpb=94653e5198a62ab14a74f61c21a4e62141158a21;p=tools%2Fhxx2salome.git diff --git a/scripts/renameSalomeModule b/scripts/renameSalomeModule index 7354291..63c90b7 100755 --- a/scripts/renameSalomeModule +++ b/scripts/renameSalomeModule @@ -1,4 +1,8 @@ #!/bin/bash +# -- +# Copyright (C) CEA, EDF +# Author : Nicolas Crouzet (CEA) +# -- usage() { @@ -8,6 +12,8 @@ usage() echo echo " -> replace any occurence of oldName by newName in module dirModule" echo + echo " (nex name cannot contain old name)" + echo echo Example : echo echo " cp -r HELLO_SRC CALCULATOR_SRC" @@ -50,6 +56,14 @@ else moduleName=$3 fi +# check names for restriction +echo $newName | grep $oldName > /dev/null +if [ $? -eq 0 ] +then + echo -e "Sorry : There is a restriction!\nNew name cannot contain old name.\n" + usage +fi + today=`date +%d%m%y` # Check arguments @@ -101,7 +115,7 @@ for file in $liste do if [ -f $file ] then - grep $oldName $file > /tmp/junk 2>&1 + grep $oldName $file > /dev/null 2>&1 if [ $? -eq 0 ] then echo $file