Skip to content

Instantly share code, notes, and snippets.

@nandomoreirame
Last active May 3, 2019 13:16
Show Gist options
  • Save nandomoreirame/144c39623b0ecb2781d66bcc2f394c25 to your computer and use it in GitHub Desktop.
Save nandomoreirame/144c39623b0ecb2781d66bcc2f394c25 to your computer and use it in GitHub Desktop.
Shell script for replace code multiples files in folder
#!/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