Skip to content

Instantly share code, notes, and snippets.

@marcingrzejszczak
Created July 10, 2017 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcingrzejszczak/6941e89e6f5a9fe2e69091345aada936 to your computer and use it in GitHub Desktop.
Save marcingrzejszczak/6941e89e6f5a9fe2e69091345aada936 to your computer and use it in GitHub Desktop.
Bash mustache replacement
#!/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