Created
July 10, 2017 15:05
-
-
Save marcingrzejszczak/6941e89e6f5a9fe2e69091345aada936 to your computer and use it in GitHub Desktop.
Bash mustache replacement
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
#!/bin/bash | |
echo "the number is {{i}} and the dog's name is {{name}}" > file.txt | |
cat file.txt | |
# the number is {{i}} and the dog's name is {{name}} | |
sed -i 's/{{i}}/5/;s/{{name}}/foo/' file.txt | |
cat file.txt | |
# the number is 5 and the dog's name is foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment