Last active
May 3, 2019 13:16
-
-
Save nandomoreirame/144c39623b0ecb2781d66bcc2f394c25 to your computer and use it in GitHub Desktop.
Shell script for replace code multiples files in folder
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 | |
SEARCH="passenger_ruby \/home\/ubuntu\/.rvm\/gems\/ruby-2.4.1\/wrappers\/ruby;" | |
REPLACE="include snippets\/passenger_ruby.conf;" | |
# Note the double quotes | |
for file in ./sites-enabled/*; | |
do | |
sed -i -- "s/${SEARCH}/${REPLACE}/g" $file; | |
echo $file; | |
# rm "$file--"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment