Last active
February 10, 2021 10:12
-
-
Save Janoyan/ce4f44c5e7f83a03ffa1bb28d62e47c1 to your computer and use it in GitHub Desktop.
This file contains 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
mappings=() | |
while IFS= read -r line; do | |
mappings+=("$line") | |
done < mappings.txt | |
for value in "${mappings[@]}" ; do | |
prefix=${value#*=}; | |
env_path=${value%=*}; | |
rm -f "$env_path" && for l in $(printenv | grep ^"$prefix"); do echo ${l#$prefix} >> "$env_path"; done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment