Created
February 19, 2013 17:20
-
-
Save andersonvom/4987933 to your computer and use it in GitHub Desktop.
Replace a given set of tokens for their respective values in a text file
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 | |
tokens="tokens.txt" | |
values="values.txt" | |
textfile="sample.txt" | |
paste $tokens $values | while read token value | |
do | |
sed -i -e "s/$token/$value/g" $textfile | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment