Salome HOME
bug : restriction : don't allow new name to contain old name.
[tools/hxx2salome.git] / scripts / renameSalomeModule
index 0347fc0dc2400e074722b4868cf3cd13401cac44..8e9ab33102ce89ab2b9b73372b9793134b68772b 100755 (executable)
@@ -8,6 +8,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 +52,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