Last active
April 9, 2020 08:50
-
-
Save aleofreddi/3d3da3162dd9e2fcb4dae6b8cabde87c to your computer and use it in GitHub Desktop.
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
#!/usr/bin/perl -p | |
# | |
# Perl implementation of envsubst for systems where it does not exist (eg. macOSX). | |
# | |
# Wed Apr 18 08:03:05 CEST 2018, Andrea Leofreddi | |
# | |
$_ =~ s/\Q${$1||$2}/$ENV{$1?$2:$4}/ while $_ =~ /(\$\{([^}]+)})|(\$(\w+))/g; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment