Skip to content
Snippets Groups Projects
Commit 18be81a5 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Add renaming script

parent b691f7a9
No related branches found
No related tags found
No related merge requests found
Pipeline #5397 failed
#!/bin/bash
#$1 flag telling whether we are in test mode or not
modify=$1
apply=false
if [[ "$modify" = true || "$modify" = t ]]; then
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
apply=true
echo "Modifying..."
fi
fi
string="StringToBeReplaced"
replace="ReplacementString"
for file in $(find include/ src/ test/ demos/ -type f); do
if [ "$apply" = true ]; then
# echo "APPLYING"
sed -Ei 's%'$string'%'$replace'%g' $file
else
# echo "NOT APPLYING"
sed -En 's%'$string'%'$replace'%gp' $file
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment