Created
June 19, 2024 09:00
-
-
Save oscarolbe/cf1caf3bb62216165aaedf35b9b568bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Variables to define the string to find and the string to replace with | |
OLD_STRING="tenant" | |
NEW_STRING="domain" | |
# Find all directories recursively and rename them | |
find . -depth -type d -name "*${OLD_STRING}*" | while IFS= read -r dir; do | |
newdir=$(echo "$dir" | sed "s/${OLD_STRING}/${NEW_STRING}/g") | |
mv "$dir" "$newdir" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment