Skip to content

Instantly share code, notes, and snippets.

@lcmartinezdev
Created July 15, 2021 02:31
Show Gist options
  • Save lcmartinezdev/8e64d6ca7441ded8a89058acd25f412e to your computer and use it in GitHub Desktop.
Save lcmartinezdev/8e64d6ca7441ded8a89058acd25f412e to your computer and use it in GitHub Desktop.
Search all .env and save in one folder
folder="envs"
find . -name "*.env" | while read line; do
new_file=$(echo $line | sed 's/\//-/g' | sed 's/\.-//g' | sed 's/-\./\./g')
echo "Copying '$line' to '$folder/$new_file'"
cp -- "$line" "$folder/$new_file"
done;
@lcmartinezdev
Copy link
Author

In local I copy all the .env files to Google Drive.
folder=~/Google\ Drive/envs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment