rename.sh
Go to the documentation of this file.
1 #!/bin/sh
2 
3 # Script to change the AnalysisExample name to something else.
4 # Usage: ./rename.sh <new-name>
5 
6 newname="$1"
7 
8 if [[ -z "$newname" ]]; then
9  echo "Usage: $(basename "$0") NewName" >&2
10  exit 1
11 fi
12 
13 # Rename the files.
14 mv "AnalysisExample_module.cc" "${newname}_module.cc"
15 mv "AnalysisExample.fcl" "${newname}.fcl"
16 
17 # Search through all the files, replacing the text "AnalysisExample"
18 # with the new name.
19 sed -i -e "s/AnalysisExample/${newname}/g" "${newname}.fcl" "${newname}_module.cc" "CMakeLists.txt"