Last active
April 21, 2017 15:27
-
-
Save tundeaoni/18033ec7c21c56c6708731a029efc761 to your computer and use it in GitHub Desktop.
Replace handlebars with env values
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
# !/bin/bash | |
if [[ -z "$1" ]] | |
then | |
echo "docker file needs to be specified"; | |
fi | |
perl -p -e 's/\%([^%]+)\%/defined $ENV{$1} ? $ENV{$1} : "\${$1}"/eg' $1 > test | |
cat test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can use substitution to
cat
the entireperl
command. Or pipe it toless