Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
18be81a5
Commit
18be81a5
authored
5 years ago
by
Joaquim Casals Buñuel
Browse files
Options
Downloads
Patches
Plain Diff
Add renaming script
parent
b691f7a9
No related branches found
No related tags found
No related merge requests found
Pipeline
#5397
failed
5 years ago
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wolf_scripts/sed_rename.sh
+28
-0
28 additions, 0 deletions
wolf_scripts/sed_rename.sh
with
28 additions
and
0 deletions
wolf_scripts/sed_rename.sh
0 → 100755
+
28
−
0
View file @
18be81a5
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment