Skip to content

Instantly share code, notes, and snippets.

View lcmartinezdev's full-sized avatar

Luis Martínez lcmartinezdev

View GitHub Profile
@lcmartinezdev
lcmartinezdev / search_envs_and_save.sh
Created July 15, 2021 02:31
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;